locked
Formatting issue of SSRS report -Urgent Help required RRS feed

  • Question

  • I have a requirement for my SSRS Table report which states the following:

    In the Planned GoLive column, highlight the dates with orange colour if report execution date (or current date) is ≥ 7 days past Planned GoLive date

     Example :  If Planned GoLive Date is Nov 05, 2013 and we execute the report today, it should be highlighted in Orange.

    Could you please help me with the SSRS expression for this scenario .

    Thanks

    Ajit

    Friday, November 15, 2013 9:06 AM

Answers

  • What type is your golivedate field?  If it's not datetime then you'll need to take that into account, for example by using CDate to convert it, something like: 

    =IIF(DateDiff("d" , CDate(fields!golivedate.value) ,  today()) >=7, "Orange" , "Transparent")

    If that doesn't help please post the error you get or details on what you see happening.



    MCITP SQL Server 2008 (BI & DEV); MCTS SQL Server 2008 (BI, DEV & DBA)
    Check out my articles at BI: Beer Intelligence?

    Friday, November 15, 2013 10:57 AM
  • format your golivedate in MM/dd/yyyy in SQL itself.

    Regards,

    Praveen

    Friday, November 15, 2013 11:05 AM

All replies

  • =IIF(DateDiff("d" , fields!golivedate.value , today()) >=7, "Orange" , "Transparent")

    select column -> F4 -> Background color -> expression

    place above code

    Hope this helps.

    Praveen

    sqlerrors

    Friday, November 15, 2013 9:59 AM
  • Hi Praveen,

    The above code did not work. I think today() must be replaced by some other format of date which takes the current date.

    Thanks

    Ajit

    Friday, November 15, 2013 10:25 AM
  • make sure your golivedate is in correct format (MM/dd/yyyy), try passing hard coded dates, like

    =IIF(DateDiff("d" , "10/31/2013",  today()) >1, "Red" , "Green")

    above code works for me.

    Regards,

    Praveen

    sqlerrors

    Friday, November 15, 2013 10:35 AM
  • Hi Praveen,

    My go live date format is in the format as shown below :

    2013-10-31 00:00:00.000

    How to write an expression for this.

    Thanks

    Ajit

    Friday, November 15, 2013 10:52 AM
  • What type is your golivedate field?  If it's not datetime then you'll need to take that into account, for example by using CDate to convert it, something like: 

    =IIF(DateDiff("d" , CDate(fields!golivedate.value) ,  today()) >=7, "Orange" , "Transparent")

    If that doesn't help please post the error you get or details on what you see happening.



    MCITP SQL Server 2008 (BI & DEV); MCTS SQL Server 2008 (BI, DEV & DBA)
    Check out my articles at BI: Beer Intelligence?

    Friday, November 15, 2013 10:57 AM
  • format your golivedate in MM/dd/yyyy in SQL itself.

    Regards,

    Praveen

    Friday, November 15, 2013 11:05 AM
  • Thanks Praveen for your help.

    I used the CDATE() as mentioned by Valentino and it helped. As you rightly pointed it was the format of the

    golive date causing issues.

    Ajit

    Friday, November 15, 2013 11:45 AM
  • Hi Valentino,

    Thanks for all you help. It worked perfectly!

    Cheers

    Ajit

    Friday, November 15, 2013 11:46 AM