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

Last WeekNumber

Status
Not open for further replies.

phpatrick

Programmer
Jul 9, 2006
72
BE
Hey,

In my query I have an expression that gives me the number of the week : [WEEK: DatePart("ww";[DAG];2)-1]

This query is feeding a report. This report should give me only the data from the last (recent) week.

The highest weeknumber is 37, how do I get this number in my SQL where clause ?

LAST or TOP ?

thanks
 
Code:
WHERE DatePart("ww",[DAG],2) > DatePart("ww",Date,2)- 1
  AND Year([DAG]) = Year(Date)
the "Year" stuff is just to ensure that you get records only from the current year.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top