Hi,
I have a query to fetch out some records based on the year,In the where clause when i am fetching on the basis of Date range i.e,1st Jan'2011 and Today's Date like
CONVERT(VARCHAR,REQDATE,101) BETWEEN CONVERT(VARCHAR,'01/01/2011',101) AND CONVERT(VARCHAR,'11/12/2011',101)
Its giving exact amount of rows but when i'm using year function like
Year(a.REQDATE )= 2011
Its not giving the exact count...what could be the scenario???
Can any one help on this Please???
Thanks,
Prasant
Loading

Pravin MorePosted Nov 13, 2011, 11:32 PM
try this.....
select CONVERT(VARCHAR,a.OpenDate,101) from Tablename a where Datepart(YYYY,a.OpenDate)=2011
Thanks,
Pravin.