Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help WIth Dates

Status
Not open for further replies.

ice7899

Programmer
May 14, 2006
59
GB
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 ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top