Results 1 to 5 of 5
  1. #1
    aphrael is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2019
    Posts
    3

    Combining Query/Report

    Trouble all to help me out with the following. Many thanks in advance.

    On Excel



    Header -> PIC Stock OUT Stock IN Quantity
    01/Oct Truck 1 Warehouse A Warehouse B 100
    05/Oct Truck 2 Warehouse A Warehouse C 50
    10/Oct Truck 1 Warehouse B Warehouse C 50

    Using the simplified excel above, can we derive the following report on access?

    Warehouse A Stock OUT Stock IN
    01/Oct ........100 / -
    05/Oct .........50 / -
    Summary ...150 / -
    Grand Total.150 / -

    Warehouse B Stock OUT Stock IN
    01/Oct .........- / 100
    05/Oct .......50 / -
    Summary ...50 / 100
    Grand Total ...- / 50

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Should be able to, although will be tricky. I expect a UNION query will be involved to rearrange data to look like:

    Date Whse Out IN
    01/Oct A 100
    01/Oct B 100
    05/Oct A 50
    05/Oct C 50
    10/Oct B 50
    10/Oct C 50

    SELECT PIC, [Stock Out] AS Whse, Quantity AS Out, Null AS IN FROM tablename
    UNION SELECT PIC, [Stock IN], Null, Quantity FROM tablename;

    Then use report Sorting & Grouping features and aggregate calcs in textboxes.

    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    aphrael is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2019
    Posts
    3
    hopefully can remain my initial format of stating 1 liner with one quantity but out/in different warehouses. Noted your suggestion works but it creates twice the entries. hoping to minimize lines.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Your example shows records grouped by warehouse. There are 2 lines for each date. Only way I know to do that is for each warehouse to have its own record for the transaction.

    My solution replicates that example - 2 lines for each date.

    Lines are minimized and achieves example provided. Why does it matter how query manipulates data as long as desired output is achieved?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    aphrael is offline Novice
    Windows 10 Access 2007
    Join Date
    Oct 2019
    Posts
    3
    Hi June, was hoping there's another shortly way to derive the results. Many thanks.

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

Similar Threads

  1. syntax for combining records in one report
    By mainerain in forum Programming
    Replies: 3
    Last Post: 02-12-2019, 10:38 AM
  2. Combining two queries into one report
    By roaftech in forum Queries
    Replies: 2
    Last Post: 08-09-2017, 03:39 AM
  3. Replies: 2
    Last Post: 03-10-2015, 12:48 PM
  4. Replies: 14
    Last Post: 07-22-2013, 12:39 PM
  5. Combining fields on a report
    By Alaska1 in forum Access
    Replies: 1
    Last Post: 12-15-2010, 12:14 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