Solved

Change Crystal Reports time format

Posted on 2011-03-23
9
641 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:BlearyEye
  • 5
  • 4
9 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 35202794
Are you trying to pass just the time or a full datetime

mlmcc
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35202841
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
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 35202938
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 1

Author Comment

by:BlearyEye
ID: 35203193
I did a search for crTwelveHour and crTwentyFourHour wrt Crystal Reports but did not find anything relevant. Can you give me a pointer?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35203277
What do you mean?

They are values for an Enumerated type.

mlmcc
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35203354
Hmmm ... that's new to me. I'll give it a try tomorrow.
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35203388
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 35203397
No.  I copied them from the Crystal format formula screen

mlmcc
0
 
LVL 1

Author Comment

by:BlearyEye
ID: 35215091
I managed to get suitable test environment set up, and your suggestion works well. Thanks.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question