I am currently storing dates in my database as char(10)
I am using coldfusion to enter values formatted as follows :
DateFormat(ExpiryDate,"yyyy-mm-dd")
In my stored procedure , I want to compare the date to now in order to filter a query. I am trying
WHERE DATEDIFF(day, ExpiryDate, getdate()) < 0
But the results are not as expected
What's the best way to handle dates ? I'd like to keep using the char data type but is it better not to ?
I am using coldfusion to enter values formatted as follows :
DateFormat(ExpiryDate,"yyyy-mm-dd")
In my stored procedure , I want to compare the date to now in order to filter a query. I am trying
WHERE DATEDIFF(day, ExpiryDate, getdate()) < 0
But the results are not as expected
What's the best way to handle dates ? I'd like to keep using the char data type but is it better not to ?