Avatar of janhoedt
janhoedt
 asked on

SSRS: color cell complex query

Hi,

I'd need a sql query to color code a date:
Items = status NOT equal to 'Status01', 'Status02'
For all items which have date less then a week => green
older then a week => orange
older then 2 weeks => red
Items which have Status Status03
and have date
older then 2 weeks orange
older then a month red

Thanks for helping with the approach!

J
SSRSMicrosoft Server OSMicrosoft SQL Server

Avatar of undefined
Last Comment
lcohan

8/22/2022 - Mon
lcohan

I believe that can be done via Data Driven Colored Text  as explained here https://www.mssqltips.com/sqlservertip/2612/data-driven-colored-text-for-reporting-services-reports/ and all needed is to focus on the
=SWITCH(Fields!Pay.Value <= 10, "Red", Fields!Pay.Value >= 20, "Green")

Open in new window

where you need to place your actual date column criteria.
janhoedt

ASKER
Thanks, but that s nowhere near to what my query should look like :-(
Can you help building the query syntax using dates?

Something like
=SWITCH(Fields!date.Value <= today-14, "Red", Fields!date.Value <= today-7, "Green")
Then if Fields.status stayus03 and date <=
ASKER CERTIFIED SOLUTION
lcohan

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck