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

Problem with DateTime

Status
Not open for further replies.

Ajith2002

Programmer
Jul 16, 2002
30
US
Hi Guys,
I've got a datetime field called CloseDate in a table 'tableA'. DB is Oracle 8i. when you run the report, a parameter(End Date, of type DateTime) will be asked to select the End Date/Time. Then I'm checking whether the CloseDate is less than or equal to End Date(parameter). Everything woks fine if I access that datetime field by adding the tableA in my report.

But i need to access that date field(CloseDate) using query. In this case, the CloseDate will be displayed in a diff date/time format, like, YYYY:MM:DD HH:MI:SS. And if I try to link this date field with the End Date(parameter) using Select Expert, it's not even showing the parameter(?End Date) in the Drop down list, instead, it displays a list of date time values in the same format(YYYY:MM:DD HH:MI:SS).
If i modify the query like this,
to_char(CloseDate,'MM:DD:YYYY HH:MI:SS')
it'll come in the proper format in the report. Again, it's giving problems when i try to link it with parameter field(End Date).
I tried giving like this in the formula editor -
DateTimeValue({Query.CloseDate}) >= {?End Date}
but, when i run the report, it gives error saying 'bad date time format'.

Any idea where i'm wrong ? Pls help!!
Thanks very much.
 
The QRY file converts DateTimes to Strings. You could add the parameter into the QRY, or you can convert the strings into true DateTime values in your report using this formula:

DTSToDateTime ( {Query.Date} ) Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top