Author |
Topic |
Ciupaz
Posting Yak Master
232 Posts |
Posted - 2012-09-14 : 10:49:07
|
Hello all,I have a cell where I change the background color with this expression:=IIF(Fields!DataEnd.Value Is Nothing, "Transparent", "Yellow")but I have also to check that if the date is present, the row has to be yellow also if is < today.How can I change this expression?Thanks a lot. Luigi |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-14 : 11:00:42
|
sorry from what i understand current condition was that it will still show it as yellow if you've value for DateEnd so for today's data also you will get row as yellowisnt that what you're asking for?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Ciupaz
Posting Yak Master
232 Posts |
Posted - 2012-09-14 : 14:31:03
|
For example, the query that populate my report's dataset gives me 2 datetime field like these:PlantID - DateStartProduction - DateStopProduction1 - 19960101 - NULL2 - 19980201 - NULL3 - 20000101 - 201012314 - 20040101 - 209912315 - 20100101 - NULL....and in my report I should show rows with yellow backgroud for the plants that are no more active. In the list above, only the 3rd plant is no more active, becaus his DateStop is passed (20101231). If a plant has a date in the future (for example, Plant=4 it will stop on 2099)or has NULL, it means that is active at the moment. The date to compare is the Getdate() of the report visualization. Luigi |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-14 : 16:48:43
|
just use like=IIF((Cdate(Now()) >= Fields!DateStartProduction.Value And Cdate(Now()) <=Fields!DateStopProduction.Value) Or (Cdate(Now()) >= Fields!DateStartProduction.Value And Fields!DateStopProduction.Value Is Nothing), "Transparent", "Yellow")------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Ciupaz
Posting Yak Master
232 Posts |
Posted - 2012-09-17 : 03:34:16
|
Perfect, it works correctly, thank you very much Visakh. Just a question: why you use the Cdate function for the Now()? I cannot simply use Now() <= ....?Luigi |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-17 : 11:29:44
|
just to make sure its converted to date and not regarded as a string value as i need to do date comparison here using >=,<= and not string (alphabetic) based comparison------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
Ciupaz
Posting Yak Master
232 Posts |
Posted - 2012-09-17 : 14:51:57
|
Ah ok, now is more clear. Thank you very much Visakh.Luigi |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-09-17 : 14:57:54
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|