dbWriter.com compare SQL date(only) to ASP date(only) asp code
SQL stores the date and time in the DATETIME fields, if you
need to compare just the date to this field then here is the code to to
strip the time off and just leave the date then compare it to an ASP
data only varilble
<%
CAST(FLOOR( CAST(YOURDATEFIELD AS FLOAT ) ) AS DATETIME )
= '" & FormatDateTime(sDate,vbshortdate) & "' "-- OR HERE IS
THE FULL SQL STATEMENT
sSQLString = "SELECT * FROM YOURTABLE WHERE "
sSQLString = sSQLString & "( CAST(FLOOR( CAST(
YOUR_SQL_DATEFIELD AS FLOAT ) ) AS DATETIME ) = '"
sSQLString = sSQLString & "FormatDateTime(YOURASPDATE,vbshortdate)
& "')"
%> |
|