Change Crystal Reports time format

I'm using VS 2010 and have the "CR for VS 2010" production release. I do NOT have a full version of CR, just the free one that works inside VS.

I have a report that displays time in 12 hr format. I need to be able to pass it a parameter and have it correspondingly give 12 or 24 hr format. Is there a way to do this?
LVL 1
BlearyEyeAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
You could pass a parameter with values 12 or 24

You can then display the time through a formula

After you put the datetime field on the report
Right click it
Click FORMAT FIELD
Click CUSTOMIZE
Click the TIME tab
Click the formula button to the right of 12 or 24 hour
Enter this

If {?Parameter} = 12 then
    crTwelveHour
Else
    crTwentyFourHour

mlmcc
0
 
mlmccCommented:
Are you trying to pass just the time or a full datetime

mlmcc
0
 
BlearyEyeAuthor Commented:
I'm not passing the time; I'm passing a parameter to control how time will be displayed.

The database variables involved are all full datetime.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
BlearyEyeAuthor Commented:
I did a search for crTwelveHour and crTwentyFourHour wrt Crystal Reports but did not find anything relevant. Can you give me a pointer?
0
 
mlmccCommented:
What do you mean?

They are values for an Enumerated type.

mlmcc
0
 
BlearyEyeAuthor Commented:
Hmmm ... that's new to me. I'll give it a try tomorrow.
0
 
BlearyEyeAuthor Commented:
btw, crTwelveHour and crTwentyFourHour are formats for I-net Crystal Clear (aka Inet Clear Reports; https://www.inetsoftware.de/reporting/feature/timeproperties.pdf). Are you sure you weren't thinking about this rather than Crystal Reports?

Anyway,will give it a run tomorrow.
0
 
mlmccCommented:
No.  I copied them from the Crystal format formula screen

mlmcc
0
 
BlearyEyeAuthor Commented:
I managed to get suitable test environment set up, and your suggestion works well. Thanks.
0
All Courses

From novice to tech pro — start learning today.