This Week is my trouble, and just Weekdays/Businessdays

Wapug

Registered User.
Local time
Today, 05:22
Joined
Apr 14, 2017
Messages
51
Goal: Create display field on form showing the current number of items processed this workweek, from TableA.FieldQ
Current Situation: I currently have TableA with a field FieldQ, in this field the total items worked are entered each morning. At the end of the day, and week I would like to be able to open up the database this information is housed in, and see both the sum of items worked that day and that week (m-f). I already have the field for the day, I am struggling a bit with the week field for some reason. I would not only like to go in it on Friday afternoon, but any day during the week and see the total of items worked from monday to whatever day Im on. I dont want Sundays counted, but I seem to be getting them. The form isnt an issue.
What I have:
Select *
From TableA
WHERE [TableA.FieldQ] BETWEEN
DateAdd("d", -((Weekday(Date()) - 1)), Date()) AND Date();
 
So you need to calculate Monday as first day of week. Try:

DateAdd("d", -((Weekday(Date(), vbMonday) - 1)), Date()) AND Date();
 
That actually gave me a pop up box prompting me to enter a parameter value for vbMonday
 
Sorry, I was testing in VBA. Use 2 instead.
 

Users who are viewing this thread

Back
Top Bottom