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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter Dates Not Working

Status
Not open for further replies.

RppDuck

Programmer
Oct 10, 2002
12
0
0
US
In our previous report writer, when prompted to enter dates between we entered them as:

From Date: 2002,10,1 To Date 2002,10,31.

Is there an option for that date type in Crystal? The regular date 10/1/2002 to 10/31/2002 is ignored on my report , and all data is returned.

Thank you
 
You can create a range string parameter and then convert them.

Record selection would have something like:

{MyTable.MyDate} >= date(minimum({?strDateParm}))
and
{MyTable.MyDate} <= date(maximum({?StrDateParm}))

I'd suggest retraining users to use Crystal dates though.

-k kai@informeddatadecisions.com
 
The problem I am having is that the Parameter for Date is not working. No matter what date range I enter, all data and all dates from the beginning of time display.

Any Ideas why? The format of the date shows it as YYYYMMDD.

Thanks
 
Are you referencing the parameter in your record selection criteria?

Use Report->Edit Record Selection->Record and place something akin to my first post in there.

Share the record selection criteria that you're using, and the SQL that's being passed (Database->Show SQL Query)

-k kai@informeddatadecisions.com
 
Rppduck,

If your date is an 8 digit integer in a YYYYMMDD format, use the NumberToDate() function to convert it to a real date. This function is available as a download on the CD website, or I can email it to you.

Then make sure your parameter data type is set to date, and make it a range-type parameter. You can just pick the dates in question from a drop down calendar when you execute the report.

Finally, tie this into your record selection formula as follows:

{MyDateField} in {?DateRangeParameter}

Let me know if I can be of help. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top