Results 1 to 3 of 3
Feb 8, 2005, 17:03 #1
SQL - compare two fields with date
I have one date field in the format "dd/mm/yyyy" that is actually a URL parameter value and a "fldAppointmentDate" field in a table of an Access 2000 database also in the "dd/mm/yyyy".
I am using the following ASP code and SQL query but it is not working
<% Dim rsAppointments__datevalue rsAppointments__datevalue = 01/01/2005 If (Request.QueryString("dateid") <> "") Then rsAppointments__datevalue = Request.QueryString("dateid") End If %> - - - - - - - - - SQL QUERY - - - - - - - - - SELECT * FROM tblAppointments WHERE fldAppointmentDate = + Replace( rsAppointments__datevalue, "'", "''") + " ORDER BY fldAppointmentStartTime ASC"
Is there a way in the SQL to compare these?
I am not sure, but I think it maybe because the URL parameter value is a string and the field in the database is a DATETIME. I have played about with the CDate() and FormatDateTime() functions but had no luck.
I only want to return rows in the database, which have dates that match with the URL parameter value.
Any suggestions would be greatly appreciatedcheers,