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!

Format a date field from within the formula

Status
Not open for further replies.

Pistol

MIS
Jan 29, 2001
59
0
0
US
I have two date/time fields that I am combining within one formula. Both fields contain both a date, and a time, and I need to combine them and format them.

Example
The database gives me this:
Field 1: 8/24/03 0:00
Field 2: 00/00/00 12:00
Field 3: 00/00/00 13:00

I need to format like the following:
"Appointment text 8/24/03 12:00-13:00"

Once I have combined the fields in the formula I cannot format the output. Here is my formula (without any formatting)

************************************************************
{BSACTIVITY_ttx.startdate} & " " & {BSACTIVITY_ttx.starttime} & "-" & {BSACTIVITY_ttx.enddate} & " " & {BSACTIVITY_ttx.enddate}
************************************************************

This data is coming out of SAP, and I cannot modify the database. Any modifications/formating has to take place in Crystal.

I know that if I put the fields on there individually I can format them the way that I want to, but then it doesn't look quite as nice.

Thanks for your help.
Peter McLernon
 
For Crystal 8.5, use ToText and date formatting.

totext ({BSACTIVITY_ttx.startdate}, "d/M/yy") & " " &
totext ({BSACTIVITY_ttx.starttime}, "HH:mm")

etc.

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top