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!

Days Mailed From Current Date Formula

Status
Not open for further replies.

WPCMS

Technical User
Jun 28, 2007
29
US
I am a brand new user of Crystal Reports 9 and am still trying to figure out SQL writing. I am trying to figure out two formulas for my report.
The first one is to take the mailed date and count the days to the current date (@days).
Then I have a formula below (written crudly I am sure) to take the @days formula and enter a command.

//IF the @days is equal to 5 days and 2nd Notice null
//then returns "Send"
//else if the @days is more than 5 and 2nd notice null
//then returns "PAST"
//else if returns "blank" because the 5 days haven't come up yet. I could also use else if less than 5 days return ""?

If {@days} is = "5" and {CS2ndNotice} =""
then "Send"
else if {@days} is >5 and {CS2ndNotice} = ""
then "PAST"
else if ""
then ""
else if {CS2ndNotice} ?????

//I am trying to say if the cs2ndnotice does have a mailed date to return "MAILED"
//instead of the commands above.

I started this and then realized I had to count business days. I found some formulas on the web to count business day but I have no idea where I would cut and paste it in the sequence. Hopefully I have made some sense.I'd appreciate any help!
Thanks

 
Try this. This is Crystal syntax.

I am using the ISNULL function so make sure that the "convert nulls to default" is not checked in the report options dialog box.


If (not isnull({CS2ndNotice}) then "Mailed"
else If {@days} < "5" then ""
else if {@days} = "5" then "Send"
else "Past"


Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
I'll try it once I know how to count days to current days. Thanks.
 
There are a number of ways to do it.

Here is one way:

CurrentDate - {table.field}

where field is either a date field or a date/time field.



Howard Hammerman,
Crystal Training and Crystal Material
On-site classes and one-on-one coaching
Low-cost telephone/email support
FREE independent Crystal newsletter
howard@hammerman.com
800-783-2269
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top