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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |