hi,
I am getting problem while selecting records for below mentioned query.
Select Min(TotalAvalablity) as TotalAvalablity from htl_FDRoomAvailability where REPLACE(CONVERT(varchar(50),ReserveDate, 101), ' ', '-')>='12/31/2009' and REPLACE(CONVERT(varchar(50),ReserveDate, 101), ' ', '-')<='01/01/2010'
Please any one help me why its showing null.If ReserveDate is between same year then its giving correct result.
Thanks,
Soumya
Select query problem for dates between different ranges
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Rekha SinghRank #1,571 · 1K reputationPosted Dec 29, 2009, 11:39 PM EST
Select * from test
where
REPLACE(CONVERT(varchar(50),Date, 102), ' ', '-')>='2009.12.25'
and
REPLACE(CONVERT(varchar(50),Date, 102), ' ', '-')<='2010.01.15'
*****************************************
Please mark it Accepted if u find it helpful.
Santhosh NRank #4,788 · 325 reputationPosted Dec 29, 2009, 11:30 PM EST
soumya shanbhag15 reputationPosted Dec 29, 2009, 11:52 PM EST
Thank u so much its working fine.