Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parameter default value = previous month

Status
Not open for further replies.

sara07

Programmer
Feb 4, 2008
23
US
Hello,

I have a stored procedure which has two parameters they both are varchar one is Year and another is Month. First user will select which year and based on that they will select month to view the report filtered. But I need to set default values on these paremters. When I go to edit paremeter for isntance: Month on default it only gives me option for jan,feb,march.. I added these manually as a static parameter.

But What I really want is default value to be previous month to be auto selected when the parameter prompt comes up. For example: Right now is March I want Febraury to be prepopulated on the propmpt.

I was trying out a formula:

?@Month is my parameter
{?@Month} = (MonthName(Month(CurrentDate)-1))
But this dont work!

How can i have default parameter for this and year.. automatically default current year. Please HELP thank you!
 
Hi, Anyone there to help me?? Is this even possible should i just worry about this if this is not possible?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top