|
-
Feb 8th, 2001, 04:09 AM
#1
Thread Starter
Member
Hi Again!
What does this mean?
**
error '80020009'
Exception occurred.
**
Here's the code that caused it
**
if trim(rsResults("Rate_Date")) = FormatDateTime(Now ,vbShortDate) then
Response.write "Test Suceeded"
else
Response.write "try Again<br>"
end if
**
Also i want to compare a date in the format of 08/02/2001 but the best I can get with the FormatDateTime is 2/8/001 .. how can i get the format of the date to the one I want.
Regards and TIA
-
Feb 9th, 2001, 12:42 PM
#2
You might try wrapping the parts of your conditional with the CDate function to ensure that you're comparing dates.
trim(rsResults("Rate_Date")) = FormatDateTime(Now ,vbShortDate)
to
CDate(trim(rsResults("Rate_Date"))) = CDate(FormatDateTime(Now ,vbShortDate))
I know of two ways to get the date format you want, and neither is very pretty. One is to make your own date formatting function that uses the Day, Month, and Year functions to compose your own format. The other is to wrap the Format$ function from VB in an ActiveX Dll and call it from your ASP.
Paul
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|