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!

how can I void Saturday and Sunday 1

Status
Not open for further replies.

112nokia

Technical User
Nov 21, 2006
12
YU
Hi I am trying t0 calculate two working days (starting the system time)from thursday and Friday for one date field. Date()+2, seems to work for Monday to Wednesday, but on THursday and Friday I need the two working days, are taken into account when calculating the date field.

So for Monday to wednesdday, needs to be 2 calendaric days, and for 4 calendaric days( or in both cases 2working days).......many thanks in advance.

 
Provided this expression is never evaluated a saturday:
Date()+2-4*(Weekday(Date())>4)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Unfortunately, Saturday is valuated on Thursday, ie Date()+2. For Thursday, the next date should be Monday.
 
Sorry for the typo. Try this:
Date()+2-2*(Weekday(Date())>4)

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

Part and Inventory Search

Sponsor

Back
Top