cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports DataDate Field

0 Kudos
213

Hello All:

In my Crystal Report, on refresh I would like to use a formula to capture the last DataDate value and pass it to my selection criteria. I tried the very simple

BeforeReadingRecords; DataDate

but DataDate apparently updates as soon as one clicks the Refresh button. So, my formula is capturing the DataDate value before reading records, but the DataDate field has at that point already updated to the current date. Is there any way I can force my formula to read the DataDate value when I click refresh, but before Crystal reads the current date?

Thanks,

Patrick

Accepted Solutions (0)

Answers (1)

Answers (1)

DellSC
Active Contributor
0 Kudos

Unfortunately, there is no way to do this using DataDate.

How are you running the report? If you're using the SDK in an application, you could add functionality that would set a "last run date" in the database (new table to track this...) This is also possible if you were to use a stored procedure to get the data for your report. The logic would be:

1. Get the last run date for the report.

2. Use that date to filter the data for the report in the "Where" clause of the query.

3. Update the last run date in the database.

-Dell