How to Use Union Queries in MS Access

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ธ.ค. 2024

ความคิดเห็น • 10

  • @ApexOfEvolution
    @ApexOfEvolution 3 ปีที่แล้ว +2

    Thanks! This came in handy. I was trying to figure out how a union query work based on another coworker's efforts.

  • @djsergeantp4013
    @djsergeantp4013 2 ปีที่แล้ว +1

    Can you do this with linked tables?

  • @asosalih9762
    @asosalih9762 2 ปีที่แล้ว +1

    dear sir you are genius, you are doing great....
    this is my question?
    what if we have two table having same columns name like;
    item_id,item_name,item_qty,item_price
    but the first table is our purchased items the second table is our sold items.
    that is the different between the two table.
    if I want to make an inventry:
    I use UNION All like the following:
    select item_id,item_name,item_qty,item_price from first_tbl
    UNION ALL
    select item_id,item_name,item_qty,item_price from second_tbl
    I just out a negative sign(-) infront of item_price of second_tbl
    then I use Aggregate Query to find the inventry, of number of Item
    it is still in stock.
    is that right
    thank you for your reply

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  2 ปีที่แล้ว

      I think this maybe can work, but in my opinion would not be the best solution. There is no need to change data. Make a query A for sum of purchased, then query B for sum of sold. Then Select from query A left joining query B. You can then add fields for A - B where you can actually see how much came in and how much went out in addition to the final total. Interesting scenario!

  • @interestingamerican3100
    @interestingamerican3100 2 ปีที่แล้ว +1

    Access Level Mastery: Asian
    Commenting for the algorithm.

  • @karimshams2574
    @karimshams2574 4 วันที่ผ่านมา +1

    are you still alive ?
    just asking 😊

    • @seanmackenziedataengineering
      @seanmackenziedataengineering  3 วันที่ผ่านมา

      Thanks for asking! Still here :-) Took a little holiday so I have not posted much over the past weeks.