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???????
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???????
Comment