1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Help With Append Query Ms Access 2003

Discussion in 'Business Applications' started by nursell, Jan 29, 2013.

Thread Status:
Not open for further replies.
Advertisement
  1. nursell

    nursell Thread Starter

    Joined:
    Jul 26, 2011
    Messages:
    143
    Hi,

    I have an append query that pulls data from 2 tables joined by the "CustNum" If the order has a seperate delivery address the program saves the the delivery address in the Customers table so then i need to join the tables by "CustNum" in the customers table and the "ShipNum" in the orders table. I was thinking is it possible to use an IIF statement?

    for example if the "ShipNum" = 0 then the join would be "CustNum" in the customers table and "CustNum" in the orders table and if the "ShipNum" is greater than 0 the join would be "CustNum" in the customers table and "ShipNum" in the orders table.

    Ihope this makes sense and someone can help me.

    Thanks.
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    I am not aware of being able to adjust joins with an IIF statement.
    You can rewrite a query DEF using VBA code.
    But is it necessary, I am not clear on what it is you are doing.
     
  3. nursell

    nursell Thread Starter

    Joined:
    Jul 26, 2011
    Messages:
    143
    If the shipnum is greater than 0 then the customers table needs to be joined to the orders table using the shipnum in the orders table otherwise if it is 0 then join using the custnum
     
  4. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Why not just 2 queries one using shipnum and one using custnum and based on the value shipnum choose the correct query.
     
  5. nursell

    nursell Thread Starter

    Joined:
    Jul 26, 2011
    Messages:
    143
    I know i can do it with 2 queries quite easily. I have about a 1000 records to append i really dont want to b splitting a 1000 orders every day. Any help using the one query will be appreciated
     
  6. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Can you show me some dummy data?
    Also the table Relationships?
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1087425

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice