skwilliams
Registered User.
- Local time
- Today, 15:52
- Joined
- Jan 18, 2002
- Messages
- 516
I have some queries which pull data from the previous week using the DatePart function for the week and year which always works fine. My problem is when the week is the first week of the year. Any help is greatly appreciated.
Here's my SQL
Here's my SQL
Code:
SELECT DISTINCT tblReprints.EmpName, tblReprints.Area, tblReprints.Order, tblReprints.Parts, tblReprints.Line, tblReprints.Ct, DatePart("ww",[dtDate]) AS Wk, DatePart("yyyy",[dtDate]) AS Yr
FROM tblReprints
WHERE (((DatePart("ww",[dtDate]))=DatePart("ww",Date())-1) AND ((DatePart("yyyy",[dtDate]))=DatePart("yyyy",Date())))
ORDER BY tblReprints.Area, tblReprints.Order;