I am trying to run a report, but I am getting the following error: "The number of days is out of range". The formula I am using is below.
NumberVar sec := Truncate({DOCUMENT.CLINICALDATE} / 1000000);
DateTime(Date (1960,01,01 ) +Truncate({DOCUMENT.CLINICALDATE} /1000000/3600/24), Time(0,0,0) + sec);
In the selection criteria for @ClinicalDate I have "LastFullMonth".
I usually use the following:
NumberVar ID := {DOCUMENT.CLINICALDATE};
NumberVar Sec := Truncate(ID / 1000000);
// Convert seconds to days
NumberVar Days := Truncate(Sec / 3600 / 24);
// Convert days to a date (and time)
DateTime(Date(1960,01,01) + Days , Time(0,0,0) + Sec)
Tried your formula: Error: The number of days is out of range.
I tried changing the filter for DOCDATA.DATA="*XXX*" (this data works) into the report and it runs, but it wont run with DOCDATA.DATA="*PATIENT INSTRUCTIONS*" for some reason.
Your formula is correct. Can you post your filter criteria?
The filters is from the same report. It's the DOCDATA.DATA that makes the difference on whether the report runs or not.
Non Working Report
{DOCUMENT.DOCTYPE} = 5.00 and
{@ClinicalDate} in DateTime (2011, 08, 01, 00, 00, 00) to DateTime (2012, 03, 01, 23, 59, 00) and
{DOCUMENT.STATUS} = "S" and
{DOCDATA.DATA} like "*PATIENT INSTRUCTIONS*" and
{DOCUMENT.SUMMARY} = "Handout Printed"
Working Report
{DOCUMENT.STATUS} = "S" and
{DOCDATA.DATA} like "*VIS*" and
{DOCUMENT.DOCTYPE} = 5.00 and
{@ClinicalDate} in DateTime (2011, 08, 01, 00, 00, 00) to DateTime (2012, 03, 01, 23, 59, 00) and
{DOCUMENT.SUMMARY} = "Handout Printed"
I have no clue. But, are you getting the same error now, or are you not getting any records?
Same error, it starts to run then errors out after reaching certain # of data.
Is there any chance that the data contains invalid dates?
I would say to write another crystal report to show what the data is in the fields.
Do not select by clinical date, but display
docdata, clinical date field, computed clinical date field
You might have some 'bad' data.
baj, no I wouldn't think so since its pulling from the same filter: DOCTYPE & SUMMARY which the dates work for the {DOCDATA.DATA} like "*VIS*".
Can you check this by just displaying all dates (without using filter on clinical date) as Joseph has suggested in his post?
{DOCUMENT.DOCTYPE} = 5.00 and
{DOCUMENT.STATUS} = "S" and
{DOCDATA.DATA} like "*PATIENT INSTRUCTIONS*" and
{DOCUMENT.SUMMARY} = "Handout Printed"
The DOCDATA.DATA like "*PATIENT INSTRUCTIONS*" works with the below filter in a new report created. The report that I last ran was last year and haven't ran it again til today.
Current Filter:
{DOCUMENT.SUMMARY} = "Handout Printed" and
{DOCUMENT.DOCTYPE} = 5.00 and
{DOCDATA.DATA} like "*PATIENT INSTRUCTIONS*"
The DOCDATA.DATA data is different compared to how it was in 2012 compared to todays? But don't see how the date formula can be a factor?
Someone may have created a document, over-riding the default date/time. That is why you want to create a report to simply list all documents selected by your docdata filter, and list out the fields.
After starting from scratch, I was able to list the clinical date into the report, but its only showing a few records whereas the report back in 2012 was much more!!
I would recommend - turn off all selection rules. Start form a really big list, then slowly put filters back in place. You should have as much data as in 2012, at least to begin with.