Trouble developing cases with query, help!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gregkas
    New Member
    • Sep 2010
    • 1

    #1

    Trouble developing cases with query, help!!

    So I'm fairly new to Access and know very little about VBA. I have a query that essentially needs an IF statement (or something comperable).

    I have a static TABLE1
    and two queries

    SELECT TABLE1.SHIPNUM, TABLE2.MULTISTO P, SUM(TABLE2.MILE S)

    **SHIPNUM is a unique identifier tied with table2**
    **MULTISTOP is a single 'P' or Null value**
    **MILES is a number value**

    I need to figure out how to select SUM(TABLE3.MILE S) from a third table if TABLE2.MULTISTO P is = 'P'. If it's not equal to 'P' and is equal to NULL, then it needs to select SUM(TABLE2.MILE S).
    So the value of TABLE2.MULTISTO P needs to determine which table MILES comes from.

    How do I achieve this???????
  • dsatino
    Contributor
    • May 2010
    • 393

    #2
    I don't think you need any VBA, just another query that you can join to the first query. After that, it should just be a simple IIF().

    Comment

    Working...