View Full Version : Combining query results


TT13
11-20-2003, 10:50 PM
Hello, I have 3 simple selection queries that return records with a currency amount. I need to combine the currency amounts into one text box on a form.

If I use text box contol source

=DSum ((DSum[queX],[currency amount])+(DSum[queY],[currency amount)+([queZ],[currency amount]))

to combine them, if ever one of the three queries does not return a record I get a null value for the currency. As a result the other two queries with a currency value are ignored and my text box is blank. As long as I get records in each all is fine.

Is there a better way to combine these three queries to avoid the null value.

THANK YOU SO MUCH!

Mile-O
11-21-2003, 01:38 AM
=Nz(DSum(field, query1)) + Nz(DSum(field, query2)) + Nz(DSum(field, query3))

Mile-O
11-21-2003, 01:40 AM
Out of interest, would a UNION query to bring all three of these queries into one be of any help?

TT13
11-21-2003, 07:47 AM
THANK YOU! Both solutions work but the Nz was the quickest to repair the form with. You saved me!! Can't thank you enough!!