Results 1 to 3 of 3
  1. #1
    kevin28 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Sep 2011
    Posts
    4

    Union or better way.


    Hi,

    I did created some queries that are helping me pull some information.
    Can someone have a look and advice if it's a way to do this same in one query or i need have at least two?

    I need find all SKU values that are not showing in table tblDC2Pick and the difference between "Date_Pick" and today's date Date() is bigger then 2.

    I believe that it's a better way to achieve that in more clean way as below is total mess...


    Thank you


    The structure of the table

    tblDC2Pick
    SKU
    Pick_Units
    Date_Pick

    tblIO
    SKU
    PO
    Qty
    Putaway_Time
    Av


    Query1
    Code:
    SELECT tblIO.SKU, qry_SumQty.CountOfQty, tblIO.PO, tblIO.Putaway_Time, tblIO.AV
    FROM qry_SumQty INNER JOIN (tblDC2Pick RIGHT JOIN tblIO ON tblDC2Pick.SKU = tblIO.SKU) ON qry_SumQty.SKU = tblIO.SKU
    WHERE (((tblDC2Pick.Date_Pick) Is Null));
    Query2
    Code:
    SELECT DISTINCT tblIO.SKU, qry_SumQty.CountOfQty, tblIO.PO, tblIO.Putaway_Time, tblIO.AV
    FROM tblIO INNER JOIN qry_SumQty ON tblIO.SKU = qry_SumQty.SKU
    WHERE (((Exists (SELECT tblDC2Pick.SKU
        FROM tblDC2Pick
        WHERE tblDC2Pick.SKU = tblIO.SKU
            AND tblDC2Pick.SKU = tblIO.SKU
    ))=False))
    GROUP BY qry_SumQty.CountOfQty, tblIO.PO, tblIO.Putaway_Time, tblIO.AV;
    qry_SumQty
    Code:
    SELECT tblIO.SKU AS SKU, Sum(tblIO.[Qty Stock]) AS CountOfQty
    FROM tblIO
    GROUP BY tblIO.SKU;

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    If you have not figured this out yet, can you explain in different words what you need to do?

  3. #3
    kevin28 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Sep 2011
    Posts
    4
    Ok Robeen,

    I need have as results in this same query:
    - All SKU's that are not showing in table tblDC2Pick
    - SKU's that get not picked for over two day's. Difference between today's date and "Date_Pick" value is bigger then two.

    I hope that it's more clear for you... I can't combine this two things into one query.

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

Similar Threads

  1. Help with a Union Query
    By Bear in forum Queries
    Replies: 12
    Last Post: 08-14-2011, 05:12 PM
  2. Union Queries
    By tarhim47 in forum Queries
    Replies: 6
    Last Post: 05-26-2011, 12:20 PM
  3. Union Query
    By jlclark4 in forum Queries
    Replies: 3
    Last Post: 02-25-2011, 08:21 PM
  4. Union Query Help
    By jo15765 in forum Queries
    Replies: 7
    Last Post: 01-06-2011, 05:46 PM
  5. Need help with a Union Query
    By jdowdy in forum Access
    Replies: 1
    Last Post: 10-13-2009, 05:24 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