cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with crystal's currentdate variable

Former Member
0 Kudos

Hi all,

I am trying to fix an old report. Here is the issue...this report is supposed to print last months data based on a create date.

It has ' create date in the period LastFullMonth ' in the record selection formula..but it is printing dec 2009 data regardless of report run date. I looked at the sql generated by this report (database -> show sqi query) and it substituted create date >= dec 01 2009 and < jan 01 2010.

I tried to print currentdate and it printed Jan 28 2010. Just to make sure there is nothing wrong with my system calendar, I created a new dummy report and printed currentdate on that report but it printed feb 08 2011 which is correct.

I was under the impression that variables like currentdate actually look at the system date but this is weird. Does any one know the reason for this behavior?

Appreciate ur help!

Pree

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If CurrentDate is giving different results on 2 different reports then there's a good chance there's an issue specific to that 1 report and you probably couldn't reproduce it even if you tried. Sometime rpt files get corrupted and while I'm sure there's a reason I've never figured out why... It just happens.

Before you go and start rebuilding the report from scratch, try replacing CurrentDate with Today or CurrentDateTime

HTH,

Jason

Answers (0)