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

formula for current date less three days

Status
Not open for further replies.

JoyCR9

MIS
Jan 13, 2004
70
CA
Crystal Reports 9.

I need assistance writing a formula where I select records where SERVICE_CALL.SERVICE_CALL_ACTION_DT is current date less 3 days (ie: 3 days ago), and print the SERVICE_CALL.SERVICE_CALL_ID.

I am having syntax issues and need perspective/help from others.

Thanks.

Group is: SERVICE_CALL.SERVICE_CALL_ID
Table is: SERVICE_CALL
Fields are: SERVICE_CALL_ID and SERVICE_CALL_ACTION_DT
 
In your select expert, add the following

{SERVICE_CALL.SERVICE_CALL_ACTION_DT} >= currentdate - 3
 
Open the Report menu, then Selection Formula, then Record
In the editor that opens up add the following line:

{SERVICE_CALL.SERVICE_CALL_ACTION_DT} = currentdate - 3

Save and Close then Preview the report.

If this doesn't solve the problem, please post more information like CR version, database and version, and then what the exact problem is. Posting your code also helps.

~Brian
 
Thanks for your reply. Just as I got notification you replied, I solved my problem with:

Local DateTimeVar d1 := currentdatetime;
Local DateTimeVar d2 := {SERVICE_CALL_EVENT.ACTION_DT};


DateDiff ("d", d1, d2) -
DateDiff ("d", d1, d2, crSaturday) -
DateDiff ("d", d1, d2, crSunday)

Plugged this into report, suppressed it, then did a record select @formula if >= 3
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top