Hi All,
I need add a parameter which it is the year into the report, then pass it to a stored procedure, then sp passes it to a function. In the function, base on the Year user selects, for example, Year 2014, value is 14, the set up the start date and end date for each quarter (the company's Year is not calendar year), so if the @Year is 2014, then the first quarter start date should be set to '10/1/@Year-1', enddate = '12/31/@Year-1', second quarter startDate='1/1/@Year', endDate = '3/31/@Year' and so on...
When I create sp, I pass the parameter, also in function, but when I pass it to function, how can I set it up to those quarter startdate and enddate?
CREATE PROCEDURE [dbo].[sp_Test] @Year int = 14
select *
from Fn_Test(@Year int)
...
CREATE function[dbo].[Fn_Test](@Year)
returns table
as
return
...
Thank you so much for any helps and suggestions!!!
I need add a parameter which it is the year into the report, then pass it to a stored procedure, then sp passes it to a function. In the function, base on the Year user selects, for example, Year 2014, value is 14, the set up the start date and end date for each quarter (the company's Year is not calendar year), so if the @Year is 2014, then the first quarter start date should be set to '10/1/@Year-1', enddate = '12/31/@Year-1', second quarter startDate='1/1/@Year', endDate = '3/31/@Year' and so on...
When I create sp, I pass the parameter, also in function, but when I pass it to function, how can I set it up to those quarter startdate and enddate?
CREATE PROCEDURE [dbo].[sp_Test] @Year int = 14
select *
from Fn_Test(@Year int)
...
CREATE function[dbo].[Fn_Test](@Year)
returns table
as
return
...
Thank you so much for any helps and suggestions!!!