Input Parameter

  • I need the Input Parameter to display monthyear in drop down fashion.

    example : Aug2013 or Feb2011

    How can I achieve this?

    Also , The source table does not have all the years , will we have to use a separate data set for this ?

  • I would use a separate dataset to generate the data. The following query creates 36 months of entries beginning at 1/1/2011.

    SELECT (CHOOSE(DATEPART(m,dateadd(month,number,'20110101')),'JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'))

    + (CONVERT(nvarchar(4),DATEPART(yyyy,DATEADD(month,number, '20110101'))))

    from master..spt_values

    where type = 'p' AND number < 36

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply