Issues with CurrentDate

I have a Crystal 2008 report that uses the following parameters to look for data…

{ICAUDIT.FLD_NBR} in [0, 21, 22, 23] and
{ITEMMAST.USER_FIELD2} startswith “X” and
{ICAUDIT.R_DATE} = CurrentDate - 1

The problem I am finding is that the report is missing data. For instance, the file that was produced on the 9th of this month, missed 2 records. I found them by going in and changing the - 1 to a - 4 and there they were.

The ICAUDIT.R_DATE field lists as 10/8/2010 12:00:00AM

So, anything that was “added” to the database on the 8th, would have the same {ICAUDIT.R_DATE} field.

I don’t have the foggiest idea as to why the report missed 2 items that matched the same criteria as the other 6 items that it found.

Does anyone have a suggestion or guess?

Thanks


mrbigles (BOB member since 2010-10-12)

Are these two items are having any null values?
Any filters applied in report?
All time stamps are same?(including two items)


anil.ganga1 :us: (BOB member since 2007-07-04)

use DATADATE instead of current date it will work…


surya.g :india: (BOB member since 2009-11-24)

Thanks for the responses!

I believe I have discovered the issue, but not sure as to why exactly. Seems the database linking got a bit screwy. Changed that and it seems items are coming through correctly now.

Thanks again!


mrbigles (BOB member since 2010-10-12)

[quote:ac703a3143=“suresh.gooty”]use DATADATE instead of current date it will work…
[/quote]

When in doubt always use DATADATE - and avoid CurrenDate, PrintDate and Today.


MJRBIM :canada: (BOB member since 2007-03-23)

Had same problem and DATADATE solved the puzzle. What is wrong with TODAY and CURRENTDATE…?


stanm (BOB member since 2008-10-06)

If you are looking at older data (eg. Saved Data or an old Instance) the report will re-calculate the formulas, etc based on TODAY or CURRENTDATE which is a DIFFERENT date (**As of NOW) than when the Data was executed against the database.

DataDate “locks” the formulas, etc to the specific-date that the Data was executed against the database.


MJRBIM :canada: (BOB member since 2007-03-23)