ASP/VB - String Date Comparison - HELP needed !

N

Neel

Hello,

I need help with string date comparison...the case
is:

MS Access field : date1 - is defined as Text.
The string value is in the form eg : '01-Jan-2003'

the SQL in ASP/VB script is like :

SELECT * from sometable
WHERE TRNCode = '" & incode & "'" & "
AND
TRNDate > '" & strLastDate & "'"

WHAT is wrong with this Test ?
TRNCode and TRDate are msaccess fields defined a text
and strLastDate is a string date as well.

Any suggestions - have tried a lot of things but the
date comparison does not seem to work.


Regards ,
Neel.
 
S

Santa

There has been no Help given on this Question ,
Is it waiting for Santa Claus -- Too hard Basket !
 
J

jon spivey

You'd need to convert the fields to date first -
SELECT * from sometable
WHERE cdate(TRNCode) = #" & incode & "#"

Or better still would be to convert the field to datetime
 
Top