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

Conditional Formatting On Date Feild In Crystal Reports 2008

Status
Not open for further replies.

tazibc

Instructor
Oct 5, 2007
66
GB
Hi Can anyone help I want to highlight a date feild in red. I have a feild {Vehicle Ins Expiry Date} I want to be able to higlight this feild in red when there is one month left before the Expiry Date. Is this possible???

basically create a flag on this feild.

I am using crystal reports 2008

help appreciated

Taz
 
How are you defining your month? 31 days - 4 weeks - Or month date (e.g. 31st of March would compare with 30th April?

If you take a basic example of anything within 31 days:

Right click the date field in your report and choose format field -> Font and click on the 'X+2' button relating to colour.

//Colour selection for font
if datediff('d',currentdate,{your.datefield}) < 1 then crblue else
if datediff('d',currentdate,{your.datefield}) < 32 then crred else crblack

This would show blue for any which have passed the expiry date, red for any which are 31 days or less from expiring and black for all those with 32 days or longer remaining.

'J

CR8.5 / CRXI - Discovering the impossible
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top