Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Missing data using Union Query 2

Status
Not open for further replies.

tahoskier

MIS
Sep 27, 2001
24
US
I'm having a problem with a union query. I have two simple select queries that I'm joining with a Union query. When I run each individual query I get all the data. For example 204 records from the qryEarnings query and 100 records from the qryDeductions. But when I run my union query I only get 300 records.

Am I missing something?

SELECT *
FROM qryDeductions
UNION SELECT *
FROM qryEarnings;

Thanks in advance

 
UNION" eliminates duplicates. Try "UNION ALL".

You should also note that all field names are taken from the first query (i.e. SELECT * FROM qryDeductions, in your case.) Even if the fields match in terms of the number and data types of fields, the field values from "qryEarnings" will be placed in the same columns as the "qryDeductions" values ... even though one is a deduction and the other is an earning.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top