By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,426 Members | 3,368 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,426 IT Pros & Developers. It's quick & easy.

Aggregate function Access

P: n/a
Yesterday this code work fine on getting monthly averages

SELECT Avg(turn1.Turn) AS Average, Format([funding date],"yyyy-mm") AS
FROM turn1
WHERE turn1.type='Renewal'
GROUP BY Format([funding date],"yyyy-mm");

However I need 'WEIGHTED averages' so
I used this code

SELECT Sum(turn1.[Th Turn]*turn1.[Funding Amount])/Sum(turn1.[Funding
Amount]) AS [WtdAvg], format(turn1.[Funding Date],"yymm") as YYMM
FROM turn1
Where turn1.type = 'Renewal';
GROUP BY format(turn1.[Funding Date],"yymm")
Im getting an aggregate error involving this particular syntax
format(turn1.[Funding Date],"yymm"). any help would be appreciated

Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.