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: Yesterday @ 9:48 AM
Points: 406, Visits: 1,219
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: Thursday, December 1, 2016 2:26 PM
Points: 131, Visits: 309
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