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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using "like" when searching dates

Status
Not open for further replies.

rickp101

Programmer
Aug 2, 2001
1
GB
I am having trouble searching for dates by their year. The dates are in date format and I need to select all results with a specific year in the date i.e. any with 2001. I have tried - WHERE date like '*2001' and many alternatives such as #*2001# etc but to no avail. Anyone help?
thanks

Rich
 
Add another field to your query called:

Year: Datepart([yourdatefield],"yyyy")

And then put your year in this field's criteria section.
 

Or try...

Where Year([DateField])=2001 Terry L. Broadbent
faq183-874 contains some tips and ideas for posting questions in these forums. Please review it if you have time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top