View Single Post
  #2 (permalink)  
Old May 8th, 2009, 12:45 PM
philip_cole philip_cole is offline
Friend of Wrox
Points: 894, Level: 11
Points: 894, Level: 11 Points: 894, Level: 11 Points: 894, Level: 11
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2005
Location: London, , United Kingdom.
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

Hi, you've got 2 issues.

1: In the If condition, the date value, 23:00:00 you are checking against should be in ""s, otherwise you will get a syntax error.

2. The String.Format bit is not quite right. The easiest way is to use the ToString method in the DateTime object to get the correct format - see MSDN:
Code:
strPendProcessDate = dtPendProcessDate.ToString("MMddyyyy");
Phil