none
show default date

    Question

  • Hi guys,

                   I need to show default date in ssrs expression

    for ex:

                   12/31/9999 and 01/01/1900 or any country format .

    if no date value is entered in parameter i want to get the above date.

    I need an SSRS expression to get the above date value

    tnkx guys

    r.b

    Saturday, July 06, 2013 7:04 AM

Answers

  • Hi R.b,

    From your description, you want the report parameter to show default value, right? If in this case, please check the "Allow blank value("")" in the report properties window. And then use the query like:
    If @Parameter=''
         Select * from table where column='12/31/9999'
    Else
          Select * from table where column=@Parameter

    If you have any questions, please feel free to ask.

    Regards,


    Charlie Liao
    TechNet Community Support

    Monday, July 08, 2013 7:37 AM
    Moderator

All replies

  • Try this:

    create table dummy_date
    (
    d_date datetime,
    label varchar(10)
    )
    
    insert dummy_date values('3/5/13','A')
    insert dummy_date values('3/7/13','B')
    insert dummy_date values(Null,'C')
    
    select label, 
    case when d_date is null then '12/31/9999' else d_date end default_date
    from dummy_date
    


    Ryan D

    Saturday, July 06, 2013 11:25 PM
  • Hi R.b,

    From your description, you want the report parameter to show default value, right? If in this case, please check the "Allow blank value("")" in the report properties window. And then use the query like:
    If @Parameter=''
         Select * from table where column='12/31/9999'
    Else
          Select * from table where column=@Parameter

    If you have any questions, please feel free to ask.

    Regards,


    Charlie Liao
    TechNet Community Support

    Monday, July 08, 2013 7:37 AM
    Moderator