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

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -