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

Find the weekendings

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi,
I'm trying to make a table of dates through a make table query but I'm having trouble finding the weekendings. The following produces Sunday to Saturday as the beginning and ending of the week but I would like Monday to Sunday.Could anyone point me in the right direction please.

FldWeekends: [FldDays]-Weekday([FldDays])+7

Thanks in advance.

 
As in:

[tt]FldDays - Weekday(FldDays, vbMonday) + 7; Weekday(FldDays, vbMonday)[/tt]
 
beginning: [FldDays] - Weekday([FldDays],2) + 1

ending: [FldDays] + 8 - Weekday([FldDays],1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the replies,

Sorry Remou I had a problem with your semi-colon,

PH yours works great.

Cheers.
 
It originally had a Debug.Print in front, to test. I removed the debig.print and forgot the second part [blush]. It should have read:

[tt]FldDays - Weekday(FldDays, vbMonday) + 7[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top