SQL Server 2000 Enterprise SP2
Need assistance with a query
Need to perform two calculation(s) to return to two new field(s) at end of recordset.
Table is "GL Account Trx Data" with GLacct#,TrxDate,TrxAmt as key fields.
select constants
Sum(Case When ?? then perform this calculation ?? end) as New_Field
where trxDAte between '2012-09-01' and '2012-09-30'
**This is going to be a query that will monthly**
( ((GLacct# = 4300)+(GLacct# = 4325)) / ((GLacct# = 4300)+(GLacct# = 4325)+(GLacct# = 4350)) ) * (GLacct# = 5000)+(GLacct# = 6000)+numerous other GLAccts
That is the layout of the formula. When GLAcct = x, use TrxAmt for GLAcct x
Not sure if Case statement is best method. Would need help is setting up case stmt, or if there is
a better method, would appreciate suggestions.
Thank you,
awaria
Need assistance with a query
Need to perform two calculation(s) to return to two new field(s) at end of recordset.
Table is "GL Account Trx Data" with GLacct#,TrxDate,TrxAmt as key fields.
select constants
Sum(Case When ?? then perform this calculation ?? end) as New_Field
where trxDAte between '2012-09-01' and '2012-09-30'
**This is going to be a query that will monthly**
( ((GLacct# = 4300)+(GLacct# = 4325)) / ((GLacct# = 4300)+(GLacct# = 4325)+(GLacct# = 4350)) ) * (GLacct# = 5000)+(GLacct# = 6000)+numerous other GLAccts
That is the layout of the formula. When GLAcct = x, use TrxAmt for GLAcct x
Not sure if Case statement is best method. Would need help is setting up case stmt, or if there is
a better method, would appreciate suggestions.
Thank you,
awaria