Query Help

R

Ryan Tisserand

I have a query with a Where statement. The results of that query are used to
populate the data iand peform calculations in the next query. If the first
query produces no results, the second does not either. How would I tell
access to put a value of 0 in one of the fields as a result in the first
query so that the second query would produce results with a field that has a
value of 0 instead of not returning any values at all?
 
K

KARL DEWEY

I have not tried this but it might work for you.
Use your query in a union query.
Create a query with subquery that counts records from your where statement.
If count is zero produce a record with 0 AS a field.
If there are record ok, if not then the second half of union will give you
the false record.
 
Top