I have a query that produces a form and I would like to have the query put out a column that basically subtracts one column from the next. I would like to create a field that subtracts SUM (PMCATGT.CURQTY) AS BUDGETHRS from SUM (PMCATGT.ACTQTY) AS ACTUALHRS. I can't get this working.
My code is as follows:
Select PMCATGT.CONTRACT,PMCATGT.PROJECT,PMCATGT.COSTTYPE,SUM (PMCATGT.CURQTY) AS BUDGETHRS,SUM (PMCATGT.ACTQTY) AS ACTUALHRS,SUM (PMCATGT.CURCOSTHM) AS BUDGETCOST,SUM (PMCATGT.ACTCOSTHM) AS ACTUALCOST,MAX (PM.STATUS)
from STDDAT.dbo.PMCATGT PMCATGT
join STDDAT.dbo.PMCONTS PM on PMCATGT.CONTRACT=PM.CONTRACT
Where PM.STATUS=30
Group By PMCATGT.CONTRACT,PMCATGT.PROJECT,PMCATGT.COSTTYPE
My code is as follows:
Select PMCATGT.CONTRACT,PMCATGT.PROJECT,PMCATGT.COSTTYPE,SUM (PMCATGT.CURQTY) AS BUDGETHRS,SUM (PMCATGT.ACTQTY) AS ACTUALHRS,SUM (PMCATGT.CURCOSTHM) AS BUDGETCOST,SUM (PMCATGT.ACTCOSTHM) AS ACTUALCOST,MAX (PM.STATUS)
from STDDAT.dbo.PMCATGT PMCATGT
join STDDAT.dbo.PMCONTS PM on PMCATGT.CONTRACT=PM.CONTRACT
Where PM.STATUS=30
Group By PMCATGT.CONTRACT,PMCATGT.PROJECT,PMCATGT.COSTTYPE