Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting dates from a particular year 1

Status
Not open for further replies.

Delboy14

Programmer
Jun 21, 2001
213
GB
I am trying to select records from a particular year, the fromat of the field is dd/mm/yyyy. I would like to select records with a date field >=2002. ie. only records enetered from this year onwards, does anyone know how to do this? I have tried:

WHERE datediff('y',2002,ConsultDate)<=0;

WHERE datediff('y',01/01/2002,ConsultDate)<=0;

WHERE ConsultDate>=01/01/2002;

but alll of these do not work does anyone have an idea? thanks in advance
 
You could also try DatePart(&quot;yyyy&quot;,[ConsultDate])>=2002
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top