hi,
I am getting problem in SQL select query.
For ex: Select * from table where date>='12/25/2009' and date<='01/15/2010'
Please tell me why this select query is not working for daterange between different year.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
radar radarPosted Jan 4, 2010, 7:34 AM
set dateformat mdy & select statement
soumya shanbhagPosted Dec 30, 2009, 3:57 AM
I tried but am not getting records.See once this query am getting null value.
Select Min(TotalAvalablity) as TotalAvalablity from RoomAvailability where REPLACE(CONVERT(varchar(50),ReserveDate, 101), ' ', '-')>='12/31/2009' and REPLACE(CONVERT(varchar(50),ReserveDate, 101), ' ', '-')<='01/01/2010'
In this ReserveDate is datetime datatype only.
Rekha SinghPosted Dec 30, 2009, 3:45 AM
pls be a bit more specific ..
the query is correct and gives output data between 2 given dates