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

Now and Datepart

Status
Not open for further replies.

vb4me

Programmer
Nov 27, 2001
48
US
I need some help with determining this week in a query and filtering it.
I have a query with the fields :
Year: Year([Tasks]![Date])
Date: Month([Tasks]![Date])
WeekGroup: DatePart("ww",[Tasks]![Date])

This works fine and with the other criteria in the query it will only return records that fall within this month in this year. The criteria I used for month and year are as follows :
Month(Now())
Year(Now())

This works fine but it returns all the weeks for this particular month and year. What I want to do is for it to return only this weeks records for this month and year.

As there is not a week(now()) option what can I do. Can I put criteria in the now function? I have tried but I keep on getting syntax errors.

Any ideas?
 
In the WeekGroup criteria, try:

DatePart("ww",Now())

Regards,

Dan
[pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top