i am creating a search function that searches the table for records greater than today. However in the database the dates are stored as varchar(10) as 10/17/2006 in column DATECOLUMN. I am trying to use the convert function to convert the date into datetime so i can compare to current date time.
WHERE CONVERT(datetime, DATECOLUMN) > GETDATE()
i think the problem is the date isn't in the correct format for the datetime... as it should be 20061017. Does anyone know how i could format the DATECOLUMN to use the convert function or another way of doing so?
Thanks VERY much!!!!
convert varchar date field to datetime
1 reply to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users