473,473 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Connecting data from two queries

34 New Member
Hi,

I have created two basic queries which both output a two column table, one (query A) has the columns 'Queue' and 'Errors' and the other (query B) has the columns 'Queue' and 'Correct'.

I need to write a query which combines the data from both to output a table with 3 columns 'Queue', 'Errors' and 'Correct'. However there are queues in query A which are not in query B and visa-versa.

How can i combine these together so that if a 'queue' has data in 'errors' but nothing in 'correct' it outputs a '0' in the 'correct' field and similarly if a 'queue' has data in 'correct' but nothing in 'errors' it outputs a '0' in the 'errors' field.

Help would be appreciated,im using access '97.
Jun 5 '07 #1
2 1799
JConsulting
603 Recognized Expert Contributor
Hi,

I have created two basic queries which both output a two column table, one (query A) has the columns 'Queue' and 'Errors' and the other (query B) has the columns 'Queue' and 'Correct'.

I need to write a query which combines the data from both to output a table with 3 columns 'Queue', 'Errors' and 'Correct'. However there are queues in query A which are not in query B and visa-versa.

How can i combine these together so that if a 'queue' has data in 'errors' but nothing in 'correct' it outputs a '0' in the 'correct' field and similarly if a 'queue' has data in 'correct' but nothing in 'errors' it outputs a '0' in the 'errors' field.

Help would be appreciated,im using access '97.
first, you'll need to change the two queries from make table to select queries

then write a union query to merge the two


select queue, errors from query1
union all
select queue, errors from query2;


now that you have the data together, with the union query you can create your maketable


use the nz() function to make null values 0


select nz([queue],0), nz([errors],0), "" as Correct into yournewtable
from unionquery

J
Jun 5 '07 #2
jonosborne
34 New Member
Thanks, it all works now.
Jun 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Bob Alston | last post by:
With all the recent discussions on ADPs and their lack of success, can someone point me to some GOOD reading on what is required to link MDBs to SQL Databases / Microsoft SQL Server 2000 Desktop...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
0
by: envywaits | last post by:
I need some help connecting my MS-Access 2003 database with a contacts list on MS-Exchange Server 2003. I can get the default field list (using the wizard) but I cannot seem to get any of the...
2
by: franc sutherland | last post by:
Hi, I am trying to build a database in Access 2003 which can connect to information in a SAGE system. Should I use ODBC, and if so, which driver is required? Is there another way of...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.