Query Help

  • Thread starter Thread starter Ryan Tisserand
  • Start date Start date
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?
 
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.
 

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