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!

range between dates

Status
Not open for further replies.

mazdaman

Programmer
Oct 17, 2003
55
GB
I need to write a query looking for a date in say 'date1' in table named availability.

BUT i would like the result showing '+' or '-' 2 weeks either side
Any ideas ?
 
Try:
Code:
... WHERE DBDate BETWEEN DateAdd("w",-2, [DateParam]) AND DateAdd("w", 2, [DateParam])

DBDate is the column you want to check and DateParam is the parameter date you wish to use. The DateAdd function adds the number of weeks ("w") specified in the second parameter (2) to the third parameter (DateParam). By using negative values (-2) you can 'subtract' weeks.



Bob Boffin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top