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
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Yesterday @ 9:18 AM
Points: 399, Visits: 1,182
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: Tuesday, April 26, 2016 8:51 AM
Points: 127, Visits: 293
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