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

Conditionally formatting a date in Crystal

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,045
US
I have a cross tab report with a paramter for the columns being Monthly or Daily. Depending upon the value of the parameter, I want to conditionally format the date field in the column.

For monthly, I want to see 'Jun-05', for daily I want to see the entire date '06/09/2005'. I fooled around with this for about an hour and got nowhere. Any ideas out there?

Please no totext() answers, I need to keep this as a date, with conditional formatting.



Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Hi dgillz,

Format your date field using the Customise button. On the date tab, enter the following conditional formulas:

Month
Code:
If {?date} = "Daily"
Then 1
Else 2
Day
Code:
If {?date} = "Daily"
Then 1
Else 2
Year
Code:
If {?date} = "Daily"
Then 1
Else 0
First Separator
Code:
If {?date} = "Daily"
Then "/"
Else "-"
Second Separator
Code:
If {?date} = "Daily"
Then "/"
Else ""
Have a good weekend,

Naith
 
Another option is to have 2 cross tabs

one set by date daily and the other set monthly
with the date field formatted accordingly and in the group option in the cross tab expert you can choose to get the data daily or monthly

place them in separeted section and suppress one or the other according to your input.

Naith solution is good but I don't know if it deals with the grouping options in the cross tab expert.



Mo
 
Naith,

Worked perfectly in v8.5....I guess I had been staring at this too long!

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top