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

Comparing dates

Status
Not open for further replies.

gazza11

Technical User
Jan 12, 2003
46
AU
I am a new user to Crystal and am trying to come to grips with the formula side of things. I have a database field that contains a date being presented in a report. I know it should not be too difficult but how do I change the color of the report entry from black to red if the date is after the current date.
 
For Crystal 8.5 under Windows NT, I do the following:

Right-click on the field and select [Format Text]

Choose the [Font] tab. Then select the formula [X+2] box. It should have Colour Constants as the section item under Functions, and you can write your formula using that. Madawc Williams
East Anglia
Great Britain
 
The formula you want to write in the area Madawc has shown you is:

If {YourDate} > CurrentDate
Then Red
Else Black

Naith
 
Many thanks again. Am busy reading user manuals, but trying to find relative examples is difficult.
Can I go one step further and ask what is I wanted to add a 14 day (or 1 month) differential into the formula.
How would I add that in.
 
Datadd("d",14,{YourDateField}) will add the 14 days Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top