'Date Time' parameter format with Crystal Reports 2008

Hello,

I have a strange problem with my Reports. I developed my report using Crystal Reports XI R2 and published it to BO Enterprise XI R2. I have a prompt with type’ Date Time’ in the report. When I run this report, i get a calender to select the date and the time value is passed as ‘12:00:00’ by default.

Now I migrated my reports to BO Enterprise 3.1 and opened the same report using Crystal Reports 2008. However, when i run this report now, i get a calender to select the date and a textbox to enter the time value like mm/dd/yyyy hh:mm:ss. By default, this time value is the current time in the system.

If I change it to 00:00:00, it takes it as 12:00:00AM only. Also if I change it to 01:00:00, it takes it properly as 01:00:00. i guess it is using a 12 hour time format instead of 24 hour time format.

I want to pass a default value of 00:00:00 to my report from the prompt. it is possible to change the 12 hour time format to 24 hour time format?
is there any alternate way of doing that?

Any help is greatly appreciated.


nandu123 (BOB member since 2009-07-15)

Hi there,

maybe you should change your format for a date only field. when I use parameter I always put only Date and not DateTime. Now, in the report, if I put something like :

open.time = date range, where open.time is a DateTime and “date range” is a “Date”, then it takes every thing from minimum(date range) at 00:00:00 to maximum(date range) at end of day 23:59:59

Hope this will help.


zorgov (BOB member since 2008-12-16)

Thank you Zorgov.

However, could you please throw some more light on ‘open.time’.

Couldnt get what you have suggested

"open.time = date range, where open.time is a DateTime and “date range” is a “Date”, then it takes every thing from minimum(date range) at 00:00:00 to maximum(date range) at end of day 23:59:59 ".

Do i need to create that in my report? :crazy_face:


nandu123 (BOB member since 2009-07-15)

Hi Nandu,

It’s only an example with my codes, open.time is a database field. My point was that if you want to pass a 00:00:00 time, you could only pass a date and not a date time --> the default time of a “date only field” is 00:00:00.

In my report, open.time is a database field in a datetime format (like (07/20/09 7:52:35) but you can equal a datetime database field with a date only parameter field.

Is it helping?


zorgov (BOB member since 2008-12-16)

Yes Zorgov. That was helpful.

But the user wants to select ‘date’ and ‘time’ both from the prompt. So i could not change the parameter type.

However, with the parameter type as ‘dateTime’ it takes the user selected date but passes a default time as 12:00:00AM only. Even if I manually change it to 00:00:00, it still passes the default time value as 12:00:00AM only.

This doesnt seem to an issue with the database. :nonod:


nandu123 (BOB member since 2009-07-15)

Here’s what my parameter screen would look like :
Can you show us yours?
Parameter.png


zorgov (BOB member since 2008-12-16)

Sure.

Please find the attached report with the problem.

The parameter type is ‘DateTime’.
Demo Report Screenshots.doc (221.0 KB)


nandu123 (BOB member since 2009-07-15)

Hi Nandu,

You have 2 possible solutions to your problem :

  1. right click on the field where you have it in your design section, click on format field. In the “Date and Time” tab, you will see that you can change the format, and you can play in the “customize” section to have the field like : MM/DD/YYYY HH/MM/SS with the time as 24h instead of 12h.

  2. second option is to change your default format, you go into “file”, and then “Options…”. In the Fields tab you will see the “Time” bouton and the “Date and Time” bouton. You would want to change the “Date and Time” so click on it and then go in the “Date and Time” tab. there you can to the same thing as option 1, but it will change the default type of all your date and time fields in all you reports, not only in this report.

I hope this will solve your issue.


zorgov (BOB member since 2008-12-16)

Thanks you very much Zorgov. You have been very helpful.

This has solved my problem. :smiley:


nandu123 (BOB member since 2009-07-15)