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

Using DAYOFWEEK Function ??

Status
Not open for further replies.

tlbrown88

Technical User
Jun 28, 2010
20
US
I'm not sure if using DAYOFWEEK is what I need but I am trying to exclude Sat and Sun from a calculation. I want to be able to look at a date and return a value of 2 days prior less the Sat and Sun. It would look something like this
Monday 6/27/2011 would read Thursday 6/23/2011.
Any help would be appreciated.
 
Try this statement:

IF DayOfWeek(CurrentDate) = 1 //For Sunday
Then CurrentDate - 3 ELSE
IF DayOfWeek(CurrentDate) = 2 //For Monday
THEN CurrentDate - 4 ELSE
IF DayOfWeek(CurrentDate) = 3 //For Tuesday
THEN CurrentDate - 4 ELSE
CurrentDate - 2




FireGeek
(currently using Crystal Reports XI with Lawson 9.01)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top