[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Format Date Time on Crystal Report

Posted on 2011-03-15
2
Medium Priority
?
739 Views
Last Modified: 2012-05-11
How can I format a CDate conversion in crystal reports to on display hh:mi.  Right now I have a column that displays CDateTime ({StartDateTime}) as 3/15/2011 23:23:27.  I need to drop the seconds off so it diplays as 3/15/2011 23:23.


Thanks
0
Comment
Question by:jmpatton
2 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 2000 total points
ID: 35138438
Right-click the field and choose format field.
0
 
LVL 11

Expert Comment

by:SAMIR BHOGAYTA
ID: 35138478
Hi,

If you have a DateTime field in Crystal Reports, you will see Date and Time tab option on the Format Editor when you right click on the field and select Format Field menu item. From the Date and Time tab, you may select the desired format and select OK.

 Custom Date Format
Custom Date Format

 

If you do not see the desired format in the available list, you can also use the Customize button that launches Custom Style dialog.

The Custom Style dialog has three tabs - Date and Time, Date, and Time. The Date and Time is used to set the order of date and time using the Order drop down and Separator drop down is used to set the separator.

 On Date tab
On Date tab, you can select the format of date the way you want. At the bottom, you will see preview of the date as well.

 On Time tab
On Time tab, you can select the format of time the way you want.

 Formatting a Formula for Date
Formatting a Formula for Date

 

What if you have a formula that has DateTime value and you want to format it? In that case, you do not see the Date and Time tab on the Format Editor.

 

In this situation, you rely on your own code.

ToText function comes handy to do all formatting. For example, I need a date formatting as following:

 

23-Mar-2007

 

The following formula will do the trick:

 

ToText({MYFIELDNAME }, "dd-MMM-yyyy")

 

I can simply move around the formatting to generate other formats. For example, if I need the following format:

 

Mar 23, 2007

 

I simply change formula to the following:

 

ToText({MYFIELDNAME }, "MMM dd, yyyy")

 

And if I need format 03/23/07, I change formula to "MM/dd/yy"
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

825 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