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

date query (Probably simple)

Status
Not open for further replies.

mrblonde

Technical User
Mar 16, 2001
187
US
Hi,

I need help with a query for a date field. The out put I'm looking for is any date within the last 21 days. I've been tinkering with the DateAdd Function but it won't take a negative number. Can someone guide me on the proper syntax?
 
Hi,

You should try

BETWEEN [Date1] AND DateSerial(Year([Date1]);Month([Date1]);Day([Date1])+21)

hope it helps! Salvatore Grassagliata
 
Hi,

Replace the ";" by the "list separator" of your system
it may be ","...

That should do it! Salvatore Grassagliata
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top