A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Union Query Not Returning A Value



 
 
Thread Tools Display Modes
  #1  
Old October 15th, 2004, 02:53 PM
Jeff G
external usenet poster
 
Posts: n/a
Default Union Query Not Returning A Value

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
  #2  
Old October 17th, 2004, 12:56 PM
Jeff Boyce
external usenet poster
 
Posts: n/a
Default

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?

--
More info, please ...

Jeff Boyce
Access MVP

  #3  
Old October 19th, 2004, 05:47 PM
Jeff G
external usenet poster
 
Posts: n/a
Default

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];


"Jeff Boyce" wrote:

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?

--
More info, please ...

Jeff Boyce
Access MVP


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Big number gives error! Sara Mellen Running & Setting Up Queries 8 October 11th, 2004 02:48 AM
Union Make Table Query Matt Running & Setting Up Queries 2 August 27th, 2004 11:30 PM
Union Query Problem Bill Sturdevant Running & Setting Up Queries 7 August 5th, 2004 03:37 PM
Union query with filter - different results on different computers Nick General Discussion 4 July 18th, 2004 05:20 AM
Edit table using union query De'Ville Running & Setting Up Queries 1 June 1st, 2004 11:46 AM


All times are GMT +1. The time now is 12:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.