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

Bad Date Format String

Status
Not open for further replies.

devnaren

Programmer
Aug 23, 2007
49
US
Hi All,

I am using CRXI and Oracle 9i. In my Database the Submitted Date field datatype is varchar2(255). the dates are stored as

10/10/2007
12/11/2007
06/06/2007
08/02/2007
05/17/2007
07/25/2007
11/16/2007 (they are in the format of mm/dd/yyyy)

I created two parameters on the report StartDate and EndDate.

When i execute the report, the date format in the parameter shows as Enter Date in the format of yyyy-mm-dd. In the record selection formula i am writing the formula as

CDate({SubmittedDate}) >= {?StartDate} and
CDate({SubmittedDate}) <= {?EndDate}

Its giving me an error as Bad Date Format String.

Is there any way to write the record selection formula to match (yyyy-mm-dd) format with (mm/dd/yyyy)



 
I think I'd just turn the parameters into string parameters, then convert them over to dates as you are doing the field value.

Maybe someone knows a paramter trick with XI. I haven't worked with that version too much.
 
Since your database date field is a string and not a date Crystal requires you to either transform the database field to a date or the parameter to a string.

But since the string in the database uses '/' and date format DD MM YYYY it may give some issues when comparing. Ie. 31/01/2001 is larger than 01/01/2008.

So, transform the string from the database to a date as you have already done.

Just make sure that the date parameter is of the type date. I suspect them to be of the type string

 
Do things a step at a time. Write a formula field with CDate({SubmittedDate}). Is that OK? Does it show correctly on the report? If so, try using the formula field in the selection.



[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top