Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Input Parameter Expand / Collapse
Posted Tuesday, October 29, 2013 1:53 PM


Group: General Forum Members
Last Login: Tuesday, October 18, 2016 2:01 PM
Points: 406, Visits: 1,214
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 ?
Post #1509557
Posted Wednesday, October 30, 2013 8:28 AM


Group: General Forum Members
Last Login: Wednesday, October 19, 2016 11:56 AM
Points: 131, Visits: 305
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
Post #1509805
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse