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

Date Format Formula 1

Status
Not open for further replies.

jbarbato

Programmer
Apr 6, 2005
56
US


I am using crystal XI with oracle 10g database...

A parameter in our reports allows our user to choose between two date formats for all of the dates that the report outputs - mm/dd/yyyy or dd-mmm-yyyy. I know how to set the date format by using the format editor, and writing functions out for the day, month, year, order, and separator. It works.

It just seems rather tedious and we will be using this date format parameter on several reports, so I would like to know if anyone has an easier way of going about this.

Thanks!!!
 
Cannot speak to Crystal Xi, but in v8.5 under file, options, fields tab, you should be able to set a default format for date fields. One you do it here, any new date object placed on your report, be it a parameter, formula, or database field, should inherit the default date format.

You can do the same for date/time fields.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
I used to do this when we had Crystal 8.5. It works fine, unless users have some other default set on their own machine.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
But that would over-ride the choice of date format that the user would have at run time.

jbarbato, it sounds like you are writing a formula in each report, for each date, and for each section of the date.

Unless you have to remain true to the datatype in your report, you could convert the date(s) is a formula, and just use the formula instead of the dates in your report.

eg:
Code:
If {?Parameter} = "dd-mmm-yyyy"
Then ToText({Your.Date},"dd-MMM-yyyy")
Else ToText({Your.Date},"mm/dd/yyyy")
Naith
 
This was useful to apply in the date format

Thank you, Naith!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top