Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Input Parameter Expand / Collapse
Author
Message
Posted Tuesday, October 29, 2013 1:53 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 8:15 AM
Points: 229, Visits: 693
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
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, September 12, 2014 10:16 AM
Points: 125, Visits: 269
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