Prasant Jinaga

Prasant Jinaga

  • 1k
  • 751
  • 425.2k

SQL Year function

Nov 13 2011 11:22 PM
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


Answers (1)