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!

Date Parameters for String fields

Status
Not open for further replies.

risman

IS-IT--Management
Mar 13, 2002
29
US
Hello,
I am using CR 8.5, SQL Server, OLE Db driver. I have a DateTime/String problem that I'm probably over thinking, but......I have a Db field ({Corrected_Date}) that is a String. The format disregards leading zeros except for minutes and seconds.: 1/1/2006 2:09:07AM 10/2/2005 2:43:00PM etc.... I am searching for records corrected between to Dates, or DateTimes, (2 parameters: FromDate & ToDate). The application generating the Crystal Report wants to querie with the String format, but I'd like to make it easier for endusers to use a Date or DateTime parameter. Then they click on a calendar button or just enter say, 1/1/2006 & 1/20/2006. The helpdesk guy said to use DateValue to convert the field.
I've tried many combos between formulas and parameter types, but I return errors or blank reports. Do I set the parameters as dates or datetimes and convert them to strings in the record selection, or vice versa, or ? Thank you.

RIS
 
I would create date parameters and convert your strings in the record selection ie

DTSToDate({DateField} = {?DateParameter}

where Dateparameter is a range parameter.

This will be slow to run as C8.5 does not pass CR formulas to database. It will have to bring back all dates and process within the report.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top