Guest phantom01 Posted January 23, 2006 Share Posted January 23, 2006 Hello !I have a litte problem but i find no solution :-(I have a Dates stored in DB like 01.01.2006 and i will get all rows start with today.My Problem:Dates in DB:20.01.200623.01.200623.01.200523.01.2007SQL: select * from db where date between now(2) and '01.01.2008'; I will also get 23.01.2005 (today = 23.01.2006)The same with: select * from db where date > now(2) I think it is only a format problem in the SQL syntax but i dont now how.Sorry for my bad english.Please Help thanksPatrick Link to comment Share on other sites More sharing options...
Kcarson Posted January 23, 2006 Share Posted January 23, 2006 What are the column types you are storing the dates in? Is it defined as a datetime column? Link to comment Share on other sites More sharing options...
pulpfiction Posted January 23, 2006 Share Posted January 23, 2006 If the datatype of the date field in not datetime, you can use CONVERT or CAST to convert to datetime. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now