Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 default stored procedure

Author  Topic 

huynhtl
Posting Yak Master

107 Posts

Posted - 2008-06-05 : 12:34:01
Hi,
I wanted to use a default for yearly instead of monthly for stored procedure, but couldn't figure out how. I usually used stored procedure @start and @end for date.
i.e. this is monthly by default
@start = jul 2007 and @end= aug 2007;
i.e. i want yearly by default
@start = jul 2007 and @end= jul 2008.

Is this too confusing?

Please help!!!!!!!!!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-05 : 13:33:38
You can tke the month and year from GETDATE() for startdate and DATEADD(yy,1,GETDATE()) for end date
Go to Top of Page
   

- Advertisement -