Multiple if then statements in query

denileigh

Registered User.
Local time
Today, 19:21
Joined
Dec 9, 2003
Messages
212
Hi all,

I have a query that I just can't figure out. We are a facility that works on rail cars. We have over 200 cars in house at the moment and the database has a daily production report in it with the status of all of the cars.

I need a query that will pull out the "AAAA" and "XXXX" cars from the list only IF the cleaning field or the mechanical inspection or BOTH fields are blank.

I can't seem to figure it out. Any help is appreciated!
 
I've tried a ton - including giving them values and calculating them. I'll go play with some of those ideas. I think part of my issue is the if A is blank or if B is blank or if both A and B are blank. That last part has me stumped.
 
Who cares if they are both blank? You only care if A is blank or if B is blank. Nothing special happens if they are both blank.

If A is Blank -> X
If B is Blank -> X
If A&B are Blank -> X
 
Plog - I need it to pull those cars in all three scenarios (A blank, B blank or both A&B blank) Will that if then work for that?
 
Please post a copy of your relationships window.
We need to see your tables and how they are related to get some idea of your database structure.

Also, it would help if you posted a copy of the SQL of the query involved.
 
Plog - I need it to pull those cars in all three scenarios (A blank, B blank or both A&B blank) Will that if then work for that?

Logically, you only have to test for 2 things: If A is blank or if B is blank. Nothing special happens if A and B are blank.
 

Users who are viewing this thread

Back
Top Bottom