I'm trying to take the day, month and year from a querystring and convert it into a data so that I can match it with a date in a record of the database.
What I write the strSQL to the screen I get the following:
SELECT * FROM Bookings WHERE StartDate = '28' + '1' + '2005'
and then the error message:
Syntax error converting character string to smalldatetime data type
I know it's because the string is not inthe format dd/mm/yy but I don't know how to change it to that format so i'm using the functions year(now()), etc.
My sql statement looks like this:
strSQL = "SELECT * FROM Bookings WHERE StartDate = '" & Request.Querystring("Day") & "' + '" & Request.Querystring("Month") & "' + '" & Request.Querystring("Year") & "'"
Any help would be appreciated. Thanks
What I write the strSQL to the screen I get the following:
SELECT * FROM Bookings WHERE StartDate = '28' + '1' + '2005'
and then the error message:
Syntax error converting character string to smalldatetime data type
I know it's because the string is not inthe format dd/mm/yy but I don't know how to change it to that format so i'm using the functions year(now()), etc.
My sql statement looks like this:
strSQL = "SELECT * FROM Bookings WHERE StartDate = '" & Request.Querystring("Day") & "' + '" & Request.Querystring("Month") & "' + '" & Request.Querystring("Year") & "'"
Any help would be appreciated. Thanks