Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to to add a default date time parameter for my SSRS parameter? Expand / Collapse
Author
Message
Posted Thursday, November 14, 2013 4:46 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, November 15, 2013 10:08 AM
Points: 3, Visits: 5
I am trying to add a default date time parameter to my SSRS parameter. 1. The condition is to date parameter should be defaulted to 01/01/YYYY 12:00:00 AM (YYYY is current year). 2. The condition is from date parameter should be defaulted to 12/31/YYYY 11:59:00 PM (YYYY is current year).

I have tried cdate,dateformat,FormatDateTime nothing worked(apparently I am making some sort of mistake).

This for AX

Some of the things I tried =CDate(Format("01/01/year(today())") & " 12:00 AM")

=Format(Parameters!MyParameter.Value, "01/01/2013 12:00") (I know it works for only one year but for now atleast)
Post #1514533
Posted Thursday, November 14, 2013 5:38 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 12:36 AM
Points: 1,651, Visits: 5,200
You haven't said what is happening when you try those things...???

MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1514544
    Posted Thursday, November 14, 2013 11:38 PM
    Forum Newbie

    Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

    Group: General Forum Members
    Last Login: Friday, November 15, 2013 10:08 AM
    Points: 3, Visits: 5
    sorry!
    First expression did pass the build -I am unable to find syntax error,
    Second one simply returns date and time is set to some thing (06:00 pm)
    Post #1514595
    Posted Friday, November 15, 2013 3:42 AM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Today @ 12:36 AM
    Points: 1,651, Visits: 5,200
    Try this for 1st of Jan this year:

    =DateSerial(Year(Today),1,1)

    and for the end of the year, take the start of next year and subtract one second

    =DateAdd(DateInterval.Second,-1, DateSerial(Year(Today)+1,1,1))


    MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1514650
    Posted Friday, November 15, 2013 10:01 AM
    Forum Newbie

    Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

    Group: General Forum Members
    Last Login: Friday, November 15, 2013 10:08 AM
    Points: 3, Visits: 5
    Thanks for your reply
    for the end date I am seeing an error "Unbound Invalid expression for Property value.Second is Invalid".As per my understanding SSRS is not recognising "Dateinterval.second".I have same problem with an expression I previously tried (=DateSerial(DatePart(DateInterval.Year, Today()), 12, 31)).Is there an aleternative for dateinterval.second? I tried second(now()) which is giving the same error.
    Post #1514784
    Posted Friday, November 15, 2013 4:40 PM


    SSCommitted

    SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

    Group: General Forum Members
    Last Login: Today @ 12:36 AM
    Points: 1,651, Visits: 5,200
    The alternative for DateInterval.Second is simply the string "s"

    =DateAdd("s",-1, DateSerial(Year(Today)+1,1,1))


    MM


  • MMGrid Addin
  • MMNose Addin


  • Forum Etiquette: How to post Reporting Services problems
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • How to Post Performance Problems - by Gail Shaw

  • Post #1514876
    « Prev Topic | Next Topic »

    Add to briefcase

    Permissions Expand / Collapse