I have a Query that I would like to add a Calculated field to. I need to add Projected Sales for 2013. The calculation would be the current count of months divided by the total year's sales times 12. I have a field for FiscalMonthNum that is not in the query yet. Can someone please show me how I could add the field I need?
SELECT
a.Vendor,
vn.ACNAME AS Vendor_Name,
a.FiscalYear,
a.QtySold,
a.ExtCost
FROM
dbo.S2K_VEND vn
INNER JOIN
(SELECT
sd.IFPRVN AS Vendor,
fc.FiscalYear,
SUM(sd.SBQSHP) AS QtySold,
SUM(sd.SBEPRC) AS ExtCost
FROM
dbo.SalesData sd
LEFT OUTER JOIN dbo.FiscalCalendar fc ON fc.FiscalDate = sd.SBINDT
WHERE
sd.SBTYPE = 'O'
AND
sd.SBINDT > '2011-12-31'
AND
sd.SBCLS NOT IN ('1500')
GROUP BY
sd.IFPRVN,
fc.FiscalYear
)a
ON vn.ACVEND = a.Vendor
GROUP BY
a.Vendor,
vn.ACNAME,
a.FiscalYear,
a.QtySold,
a.ExtCost