Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Boolean Formula using dates Post Reply Post New Topic
Author Message
duffey01
Newbie
Newbie
Avatar

Joined: 04 May 2009
Location: Australia
Online Status: Offline
Posts: 39
Quote duffey01 Replybullet Topic: Boolean Formula using dates
    Posted: 19 May 2015 at 7:24pm
Hi All

I need to highlight the same field different colours based on a date.

If 'Date Required' is less than 7 days from todays date I need 'Request No.' highlighted red. I've done this using the format editor.

If 'Date Required' is between 8 & 14 days from todays date I need 'Request No.' highlighted orange. This I'm having problems with.

Details {req_no} {title} {date_req} {date_raised}

I know I need to write a formula to find the 'date raised' is between 8 and 14 days previous to current date, but I can't.

I hope I've included enough info.

Thanks in advance for your help.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 May 2015 at 3:54am
not sure if this is the field value or the background so you may need to adjust the last else to crNoColor and you also have no color indicated for = 7 days so I included that in the red...
 
if datediff('d',table.date_req,currentdate) <=7 then crred else
if datediff('d',table.date_req,currentdate) in 8 to 14 then color(255,128,0)else crblack
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.