I would like to create a stored procedure for this query.
Can I do this?
My query is in a loop where month_num increments from 1 to 18 and #project_number# is passed from another query:
<set month_num = 1>
SELECT Sum(month#month_num#) AS total_month
FROM .manload.dbo.monthly_manload
WHERE dept IN (50,51,52,55)
and project_number = '#project_number#'
<set month_num = month_num + 1>
Can I do this?
My query is in a loop where month_num increments from 1 to 18 and #project_number# is passed from another query:
<set month_num = 1>
SELECT Sum(month#month_num#) AS total_month
FROM .manload.dbo.monthly_manload
WHERE dept IN (50,51,52,55)
and project_number = '#project_number#'
<set month_num = month_num + 1>