Puzzle with query expression

  • Thread starter Thread starter Frank
  • Start date Start date
John:

That is right.

Your query functions sort of like a filter within a filter. You filter for
one set of criteria, then within that filter, you filter for another. In
your query, it working like that. The end result of it is that it return
only two records, those that have phone numbers in all four fields. It seems
that it working in reverse.

Maybe this is beyond what Access can handle.

No, Access can handle far more complex queries than this! Try getting rid of
the extra parentheses:

SELECT Addresses.Phone1, Addresses.Phone2, Addresses.Phone3,
Addresses.Phone4
FROM Addresses
WHERE Addresses.Phone1<>"N/A" AND Addresses.Phone2<>"N/A" AND
Addresses.Phone3<>"N/A" AND Addresses.Phone4<>"N/A";

Or, reverse the logic:

SELECT Addresses.Phone1, Addresses.Phone2, Addresses.Phone3,
Addresses.Phone4
FROM Addresses
WHERE NOT (Addresses.Phone1="N/A" AND Addresses.Phone2="N/A" AND
Addresses.Phone3="N/A" AND Addresses.Phone4="N/A");

John W. Vinson [MVP]
 
Hey John:

The following SQL code worked to perfection. It was your reverse logic that
did the trick.


SELECT Addresses.Phone1, Addresses.Phone2, Addresses.Phone3,
Addresses.Phone4
FROM Addresses
WHERE NOT (Addresses.Phone1="N/A" AND Addresses.Phone2="N/A" AND
Addresses.Phone3="N/A" AND Addresses.Phone4="N/A");


I want to express my deep appreciation for all the time and effort you spent
with me in order to resolve this sticky problem. Also, I want to give many
thanks to all of the other contributors for their enlighting comments. You
all perform a mighty service to those in need within the database cyber
community. Keep up the excellent work.

Thanks once again all for your professional assistance,

Frank
 
Hey John:

The following SQL code worked to perfection. It was your reverse logic that
did the trick.

That's good to know - I'm still perplexed that the other syntax didn't work!
I want to express my deep appreciation for all the time and effort you spent
with me in order to resolve this sticky problem. Also, I want to give many
thanks to all of the other contributors for their enlighting comments. You
all perform a mighty service to those in need within the database cyber
community. Keep up the excellent work.

Thanks once again all for your professional assistance,

You're welcome, and thanks for the kind words.

John W. Vinson [MVP]
 
Back
Top