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

end of the week code?

Status
Not open for further replies.

Finedean

MIS
May 4, 2006
80
US
Hi All,
I have a field (in a query) called Start date.
Our company work days are Friday to Saturday. I am looking for a way to add a field called End date to generate the last day of the week date(which is Saturday).
For example:

Start day End day

05/15/2006 05/20/2006
05/17/2006 05/20/2006
05/19/2006 05/20/2006

05/24/2006 05/27/2006
05/25/2006 05/27/2006

thanks

Dean
 
Finedean,
7 is the default value for Saturday using the [tt]Weekday()[/tt] function so you could do this in your query: [tt][End Day]: [Start Date] + (7 - Weekday([Start Date]))[/tt]

Hope this helps,
CMP

(GMT-07:00) Mountain Time (US & Canada)
 
Correction:
Company work day are Monday to Saturday.
Thanks
Dean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top