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

Converting DateTime to include Time 1

Status
Not open for further replies.

frieb

Technical User
Aug 8, 2005
13
US
WIthin Crystal I have a datetime field (date) that only displays the date and in the database it does display the date and time. What do I need to do to convert this field to display both the date and time on the report? From here, I will need to use the DateDiff (s) functionality to get the difference between two datetime fields.
 
What version of Crystal?
In some earlier versions, (I think 8.5 and earlier) there was a setting to "Convert Date-time to Date".
If this is turned on (FILE-REPORT OPTIONS for a single report and then FILE-OPTIONS-REPORTING tab for global settings), then you'll need to turn it off and refresh the report.
You'll likely need to format the fields to display the time part (right-click on the field and choose FORMAT FIELD)

If you're working with version 9 or later, then it's just a matter of formatting.


Bob Suruncle
 
Check File > Options >Fields, you'll find a general setting for date/time fields, among other things.

You can also use ToText to display a date or date-time field in a particular format. Relying on the default can cause problems if the report is run on another PC with differetn setting.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top