how tgo compare datevalues in sqlserver, asp and Access



hi I have a real problems with comparering date in asp and sqlserver
In sqlserver I have a table tblDates with the field dtmDate

the field dtmDate in a sqlserver table may contain a date like
2005-07-30 08:46:54.000
(it was eported from Access)

and then in asp I want to create a date like:

DIM MYDATE
MYDATE = now()
( which is for example 9/8/2007 3:51:51 PM )

THEN i WANT TO substract 6 months from MyDate
( if mydate is 9/8/2007 3:51:51 PM I want it to become
9/2/2007 3:51:51 )

and then I would like to use a sqlstring like

select * from tbldate Where & " dtmdate >= "& mydate

but as the dates formatted differently in sqlserver and asp I don't
know how to handle this.

Hope that someone may help me with this.

Regards BigOlle

.



Relevant Pages