Subqueries with null values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

This is a query that I use. The problem is for time to time one or more of
the subqueries that I use will have a null value which causes the main query
to return null. How do I make this work?

SELECT Table1.[Job Number], Table1.SetterCompany, Table1.[File Number]
FROM Table1, QryShowSetterOpen, QryShowSetterNonSys, QryShowSetterDueToday
WHERE (((Table1.[File Number])=[QryShowSetterOpen]![File Number] Or
(Table1.[File Number])=[QryShowSetterNonSys]![File Number] Or (Table1.[File
Number])=[QryShowSetterDueToday]![File Number]));
 
If the outer query returns null, then I would expect that to be the correct
behaviour because the criteria has not been met. But if you want the inner
query to return something else if something within it cause a null return,
then modify either the inner or outer query (or both) to account for nulls,
using Nz().

Check the online Help for how to use it.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
(Currently in Japan)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top