dbljackson
Programmer
I'm using SQL Server 7.0 and would like to use a
parameter for a table column name in a "SUM" aggregation.
Code:
Select
sum(case when Fweek=@Curweek-8 then (quantity*Dollars) else 0 end) 'Week-8'
from ....
Can the (Quantity*Dollars) expression be passed as a parameter? I have other aggregations for this same table
ex. "(total/quantity)"
I have been unsuccessful thus far but am SQL Server newbie.
TIA
parameter for a table column name in a "SUM" aggregation.
Code:
Select
sum(case when Fweek=@Curweek-8 then (quantity*Dollars) else 0 end) 'Week-8'
from ....
Can the (Quantity*Dollars) expression be passed as a parameter? I have other aggregations for this same table
ex. "(total/quantity)"
I have been unsuccessful thus far but am SQL Server newbie.
TIA