Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    28

    Unanswered: Query to sum of rows

    Hi I have an access cross tab query which is

    TRANSFORM Sum([z - AUSBNRPT].ISSEXP) AS SumOfISSEXP
    SELECT [z - AUSBNRPT].PCNAME, [z - AUSBNRPT].ACCMN, [z - AUSBNRPT].SECRAT
    Null AS [Total Exposure], FROM [z - AUSBNRPT]
    WHERE ((([z - AUSBNRPT].PCNAME) Like "Westpac Banking Corp*" Or ([z - AUSBNRPT].PCNAME)="Australia & New Zealand Banking Group Ltd" Or ([z - AUSBNRPT].PCNAME)="ANZ Banking Group" Or ([z - AUSBNRPT].PCNAME)="Commonwealth Bank of Australia" Or ([z - AUSBNRPT].PCNAME)="National Australia Bank Ltd" Or ([z - AUSBNRPT].PCNAME)="Macquarie Group Ltd" Or ([z - AUSBNRPT].PCNAME)="Suncorp-Metway Ltd" Or ([z - AUSBNRPT].PCNAME)="Bank of Queensland Ltd"))
    GROUP BY [z - AUSBNRPT].PCNAME, [z - AUSBNRPT].ACCMN, Null, [z - AUSBNRPT].SECRAT
    PIVOT [z - AUSBNRPT].DSKNM;


    In the Total Exposure (highlighted in the query) I want to display the sum of values across the rows mentioned in the Where criteria. Is there anyway to do this? Right now the way I do it is to display a blank column and do the addition manually. Thanks in advance for the help

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    SELECT ... SUM(...) AS [Total Exposure] should do the trick.

    Have a nice day!

  3. #3
    Join Date
    Feb 2009
    Posts
    28
    Awesomo...Thanks Sinndho...

    Have a nice weekend

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •