Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Date between Main Report and Sub Report ERROR "A Date is Required here". 2

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
US
I have two Dates that im sharing between reports:
@SharedFromDate
Whileprintingrecords;
Shared DateVar FDate := {@FROMDATE}
@SharedToDate
Whileprintingrecords;
Shared DateVar TDate := {@TODATE}

but when ruuning the report, the main reports has an error message for the SharedFromDate is "A Date is required here".:
 
Is there a chance that there may be an invalid date or a null value in the date field?
 
Also I do not think Crystal accepts Date/times as Dates. You either have to convert the date/time to a date field or use a DateTimeVar.
 
Thanks to both, I found that it was a text/string value. So I elimiated the shared var and create a FTDate and a TDate formula to "cDate(ToText(cDate({@FDATE}),"dd/MM/yyyy"))" and cDate(ToText(cDate({@TDATE}),"dd/MM/yyyy")).
this work just fine until i dont enter in a date range(which is preferred at times) and the errors out. I thought that this forumal would address this issue of having the date be null.
if isnull({@FDate}) and isnull({@TDate}) then
{@WorkDate} in Date (1999,01,01) to Date (2025,01,01).

Im still unable to run the report without any dates.
 
Do you have "Default Values for Nulls" selected in your formula? Also I am not sure what you are trying to accomplish with the {@WorkDate} in Date (1999,01,01) to Date (2025,01,01). I think that would return a Boolean.
 
if you want to also include dates that are null from a database field, you have to add
or isnull({YourDateField})
to the existing condition.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top