Results 1 to 2 of 2
  1. #1
    radujit is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    1

    matrix display

    Control Panel URLUsernamePassword


    http://dnp.alpshost.com
    vreauvac
    nbjdbeMCmY

    I have two tables
    Banks(Bank_id, Bank)
    FX (ID, Bk_id, currency, trans, value)
    Banks and FX are innerjoined on Banks.Bank_id=FX.Bk_id.

    in the original table in database:
    Code:
    Code:
    ID   Bank    Transaction type    Currency   Value
    1    X         Buy                      EUR          1
    2    X         Sell                      EUR          2
    3    X          Buy                     USD          3
    4    X          Sell                     USD          4
    5    y         Buy                      EUR          5
    6    y         Sell                      EUR          6
    7    y          Buy                     USD          7
    8    y          Sell                     USD          8
    Data should be displayed as follows:
    Code:
    Code:
    Bank                   EUR - Buy       EUR - Sell     USD-Buy         USD-Sell
    X                      1               2              3               4
    y                      5               6              7               8
    Now here is the sql:
    Code:
    SELECT Bank_id, 
    (select distinct value from fx where currency = 'EUR' and trans = 'buy' and bk_id = Bank_id) as 'EUR - buy',
    (select distinct value from fx where currency = 'EUR' and trans = 'sell' and bk_id = Bank_id) as 'EUR - sell',
    (select distinct value from fx where currency = 'USD' and trans = 'buy' and bk_id = Bank_id) as 'USD - buy', 
    (select distinct value from fx where currency = 'USD' and trans = 'sell' and bk_id = Bank_id) as 'USD - sell'
    FROM Banks
    group by Bank_id
    The error I get is "The subsql must contain at least one value.

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    Can you post the code where you receive the error i.e. the subsql

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Create Report in a Matrix Format Like Excel
    By ortley77 in forum Reports
    Replies: 1
    Last Post: 08-24-2010, 09:56 AM
  2. Automatically updating matrix
    By reuip in forum Access
    Replies: 2
    Last Post: 06-08-2010, 08:04 AM
  3. Report control of a field display/no display
    By systems013 in forum Reports
    Replies: 5
    Last Post: 02-01-2010, 09:44 AM
  4. Display last five records only
    By premdasp in forum Queries
    Replies: 3
    Last Post: 11-18-2009, 11:53 AM
  5. Combo Box Display
    By ssaucedo in forum Reports
    Replies: 17
    Last Post: 08-10-2009, 05:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums