Current

kirky007

Registered User.
Local time
Today, 04:11
Joined
Aug 22, 2005
Messages
24
I need a query so that only date in the current week ending are shown i.e. so that the query automatically updates every week to show the latest data for the week ending.

Cheers,

Andy
 
Current week? Last week? Next week?
How is the "week" to be determined?
If the start or end of the week is entered, then a simple dateadd x days (forward or backward) will get you a date range to query on (assuming you are comparing to a date). You could also use datepart to extract the week and use that (but it is much slower than a date range).
 
The user will enter a date worked and i want my subform to update and only show dates for week ending... it would also be nice to have this date shown on the top of the page.
 
Do you want the query to always return the current week?
Between DateAdd("d", (weekday(date()) * -1) + 1, date()) And DateAdd("d", (7 - weekday(date())), date())
...in the query criteria will allways return the range of last Sunday thru next Saturday.
If you want it to work from a form field, refer to the form field in place of "date()".
 
Yeh.. ive manipulated that formula a little and everything seems to work fine.

Ta very much,

Andy
 

Users who are viewing this thread

Back
Top Bottom