Union Query Not Returning A Value

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

Guest

I have five union queries that pull information from other queries of
different years related to specific project managers.

All of the original queries are working properly and pulling the appropriate
information from the tables.

Each main query looks for records and their associated "type" which is shown
in the "type" column. Each query is properly showing the type column and the
result for each record.

The problem is with three of the five union queries which are losing
information in the "type" column. The type column is listed in the union
queries but there are no results in the column.

Any help would be greatly appreciated.

Jeff
 
Jeff

Without some idea of the actual SQL statements you are using, it will be
tough to diagnose what isn't working correctly.

However, if three of your queries return no data, can you confirm that there
actually is data "underneath" that isn't being returned, or is it the case
that no data meets the criteria you have set?

If you break any one of those three Union queries into their respective
individual queries, do any of those return data ... and is there any data?

As an aside, a well-normalized database design might not need multiple union
queries to assemble "years" data. Can you provide a description of your
data structure that requires this?
 
I didn't mean to be vague so here are the SQL statements for the union query.
Each individual query does show data for the "Type" column. It's only when
the union query is run does the data disappear although the column does
appear in the union query result. The only difference between the 5 union
queries is the initials used change to the appropriate project manager and
the associated queries for that project manager.

Example:

SELECT [2000 Project List Query - DV].[Project Number], [2000 Project List
Query - DV].[Project Name], [2000 Project List Query - DV].[Report Due Date],
[2000 Project List Query - DV].[Field Work Completed], [2000 Project List
Query - DV].[Comments], [2000 Project List Query - DV].[Client], [2000
Project List Query - DV].[Type], [2000 Project List Query - DV].[Priority
Level]
FROM [2000 Project List Query - DV];
UNION ALL SELECT [2001 Project List Query - DV].[Project Number], [2001
Project List Query - DV].[Project Name], [2001 Project List Query -
DV].[Report Due Date], [2001 Project List Query - DV].[Field Work Completed],
[2001 Project List Query - DV].[Comments], [2001 Project List Query -
DV].[Client], [2001 Project List Query - DV].[Type], [2001 Project List Query
- DV].[Priority Level]
FROM [2001 Project List Query - DV];
UNION ALL SELECT [2002 Project List Query - DV].[Project Number], [2002
Project List Query - DV].[Project Name], [2002 Project List Query -
DV].[Report Due Date], [2002 Project List Query - DV].[Field Work Completed],
[2002 Project List Query - DV].[Comments], [2002 Project List Query -
DV].[Client], [2002 Project List Query - DV].[Priority Level], [2002 Project
List Query - DV].[Type]
FROM [2002 Project List Query - DV];
UNION ALL SELECT [2003 Project List Query - DV].[Project Number], [2003
Project List Query - DV].[Project Name], [2003 Project List Query -
DV].[Report Due Date], [2003 Project List Query - DV].[Field Work Completed],
[2003 Project List Query - DV].[Comments], [2003 Project List Query -
DV].[Client], [2003 Project List Query - DV].[Priority Level], [2003 Project
List Query - DV].[Type]
FROM [2003 Project List Query - DV];
UNION ALL SELECT [2004 Project List Query - DV].[Project Number], [2004
Project List Query - DV].[Project Name], [2004 Project List Query -
DV].[Report Due Date], [2004 Project List Query - DV].[Field Work Completed],
[2004 Project List Query - DV].[Comments], [2004 Project List Query -
DV].[Client], [2004 Project List Query - DV].[Priority Level], [2004 Project
List Query - DV].[Type]
FROM [2004 Project List Query - DV];
UNION ALL SELECT [2002 Project List Query - CW].[Project Number], [2002
Project List Query - CW].[Project Name], [2002 Project List Query -
CW].[Report Due Date], [2002 Project List Query - CW].[Field Work
Completed],[2002 Project List Query - CW].[Comments], [2002 Project List
Query - CW].[Client], [2002 Project List Query - CW].[Priority Level], [2002
Project List Query - CW].[Type]
FROM [2002 Project List Query - CW];
UNION ALL SELECT [2003 Project List Query - CW].[Project Number], [2003
Project List Query - CW].[Project Name], [2003 Project List Query -
CW].[Report Due Date], [2003 Project List Query - CW].[Field Work Completed],
[2003 Project List Query - CW].[Comments], [2003 Project List Query -
CW].[Client], [2003 Project List Query - CW].[Priority Level], [2003 Project
List Query - CW].[Type]
FROM [2003 Project List Query - CW];
UNION ALL SELECT [2004 Project List Query - CW].[Project Number], [2004
Project List Query - CW].[Project Name], [2004 Project List Query -
CW].[Report Due Date], [2004 Project List Query - CW].[Field Work Completed],
[2004 Project List Query - CW].[Comments], [2004 Project List Query -
CW].[Client], [2004 Project List Query - CW].[Priority Level], [2004 Project
List Query - CW].[Type]
FROM [2004 Project List Query - CW];
 
Back
Top