Click to See Complete Forum and Search --> : How to obtain absolute today


sflaumen
March 7th, 2006, 09:32 AM
In Crystal Reports XI, I would like to have today's date be displayed and used in functions, but not be changed after the report has been generated. Currently, when previously generated reports are displayed days later, the date is re-calculated based on the present instead of being fixed when the report was produced.

I have not found out how to do this. CR doc says CurrentDate is synonymous with PrintDate (which is always based on now). Also, CurrentDate is equivalent to the obsolete function Today so that may not be the answer.

Jacksc
March 7th, 2006, 02:32 PM
Depending on what you are trying to accomplish, you may just want to use the parameter function of Crystal Reports (http://www.saveonsupport.com) and have a prompt for the date to use when the report is run.

sflaumen
March 7th, 2006, 02:34 PM
yes I realize this would work, but don't want to force the user to enter today's date. The report runs on a daily basis without user involvement.

Jacksc
March 7th, 2006, 03:18 PM
Would exporting your Crystal Reports (http://www.saveonsupport.com) to PDF files be acceptable? Then you would essentially have pictures of past reports however this will take up disk space...

sflaumen
March 7th, 2006, 03:20 PM
good idea. That's what I suggested to the user's to do in the meantime. Since we keep instances around, fixing this would be best.

sflaumen
March 22nd, 2006, 04:35 PM
For anyone else who wants to know how to do this:
You must use the function DataDate instead of any other date function.
Ex. for "yesterday" you can do:
Date(DateAdd("d",-1,DataDate));