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

Find out Crystal Day?

Status
Not open for further replies.

leightur

IS-IT--Management
Jan 25, 2008
42
0
0
GB

What I want to find out, how to get Crystal to output the current day - if today = Friday then currentdate + 4 else currentdate+2

I have a the following formula:

{ESTJOB.DUE_DATE} in {@Deliveries from date} to {@Deliveries to date}

{@Deliveries from date} - currentdate
{@Deliveries to date} - currentdate+2
 
I have also tried this, but did not work :-(

//If DayOfWeek({ESTJOB.DUE_DATE}) = 6 Then
//currentdate + 4
//Else currentdate + 1
 
Try the following for a selection formula:

(
(
dayofweek(currentdate) = 6 and
{ESTJOB.DUE_DATE} in currentdate to currentdate + 4
) or
{ESTJOB.DUE_DATE} in currentdate to currentdate + 2
)

Or you could just change your end formula to:

If DayOfWeek(currentdate) = 6 Then
currentdate + 4 Else
currentdate + 2

These formulas only accommodate Fridays though.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top