sql - Add a Percent of Total Column in Access Query -


i have following query:

select [3-2017].[dealer#], sum([3-2017].balance) sumofbalance [3-2017] group [3-2017].[dealer#]; 

i want add column returns percent of grand total each dealer#. think need single-row query totals , join or union somehow, i'm lost.

i've looked through few different posts , this top result, doesn't solve problem, unfortunately.

really best , easiest done in report. however, try:

select [3-2017].[dealer#], sum([3-2017].balance) sumdealerbal,     (select sum(balance) [3-2017]) sumbalance, sumdealerbal/sumbalance dealerpct    [3-2017]   group [3-2017].[dealer#]; 

advise no spaces or special character/punctuation (underscore exception) in names. better dealernum or dealer_num.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -