473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

i have 3 queries. i need one result

greetings. first, i apologize for asking an old question. it appears
that i'm looking for a solution that was already given but it don't
seem to fit my scenario. so thanks for putting up with me.

here's what i have.

a table called "RESULTS" - this table has 4 columns i need to work
with. CustID, Matrix, Test, Parameter.

i have three select queries that perform a count on how many times a
certain "Parameter" is listed.

the first query produces results for all customers (no filtering of
CustID). ** For this message post I'll use the Parameter of "ALUMINUM"
as an example.

so, my first query produces all CustID with Paramter:ALUMINUM appearing
155 times.

my second query (through query design view) filters CustID using; <>
"InHouse". my result for the second query is ALUMINUM appearing 153
times.

my third query (through query design view) filters CustID using;
"InHouse". my resut for the third query is ALUMINUM appearing 2 times.
So my math and three queries are correct.

What I have been trying to do is get ONE query/table that will show a
header with the following; MATRIX, TEST, PARAMETER, Count of Query1,
Count of Query2, Count of Query3.

so that my data row will have; (data for Matrix), (data for Test),
ALUMINUM (aluminum is the data for parameter), 155, 153, 2

the three counts is what is killing me. i can't get the three queries
into one so that i can carry one report instead of three.

This is a long post. I apologize. I'm almost done. Query2 & Query3
which are a subset of Query1 have less data. By this I mean that
ALUMINUM appears on all three but another item like IRON will appear in
Query1 (of course) and Query2 but not in Query3 - or Query3 will show
'0' as a count when all three queries appear side by side (naturally
since there is no "IRON" results for CustID "INHOUSE" generated in
Query3).

I hope i wrote enough detail. I had accomplished this last year but
have lost my original query and the backups on disk. I appreciate the
posts.

I've tried Unions, Crosstabs, Table Creation and then another 4th
query. I've been on this so long, i'm running in circles.
Thanks again.

Nov 13 '05 #1
2 1613
Create a fourth query that includes your three queries. Join Query2 to
Query1 on CustID. Click on the join line and change the join type to the one
that says something like Include all of Query1 and matches from Query2. Join
Query3 to Query1 on CustID. Click on the join line and change the join type
to the one that says something like Include all of Query1 and matches from
Query3.

Create a fifth query that includes the fourth query. Change the fifth query
to Crosstab.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
<ro******@hotmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
greetings. first, i apologize for asking an old question. it appears
that i'm looking for a solution that was already given but it don't
seem to fit my scenario. so thanks for putting up with me.

here's what i have.

a table called "RESULTS" - this table has 4 columns i need to work
with. CustID, Matrix, Test, Parameter.

i have three select queries that perform a count on how many times a
certain "Parameter" is listed.

the first query produces results for all customers (no filtering of
CustID). ** For this message post I'll use the Parameter of "ALUMINUM"
as an example.

so, my first query produces all CustID with Paramter:ALUMINUM appearing
155 times.

my second query (through query design view) filters CustID using; <>
"InHouse". my result for the second query is ALUMINUM appearing 153
times.

my third query (through query design view) filters CustID using;
"InHouse". my resut for the third query is ALUMINUM appearing 2 times.
So my math and three queries are correct.

What I have been trying to do is get ONE query/table that will show a
header with the following; MATRIX, TEST, PARAMETER, Count of Query1,
Count of Query2, Count of Query3.

so that my data row will have; (data for Matrix), (data for Test),
ALUMINUM (aluminum is the data for parameter), 155, 153, 2

the three counts is what is killing me. i can't get the three queries
into one so that i can carry one report instead of three.

This is a long post. I apologize. I'm almost done. Query2 & Query3
which are a subset of Query1 have less data. By this I mean that
ALUMINUM appears on all three but another item like IRON will appear in
Query1 (of course) and Query2 but not in Query3 - or Query3 will show
'0' as a count when all three queries appear side by side (naturally
since there is no "IRON" results for CustID "INHOUSE" generated in
Query3).

I hope i wrote enough detail. I had accomplished this last year but
have lost my original query and the backups on disk. I appreciate the
posts.

I've tried Unions, Crosstabs, Table Creation and then another 4th
query. I've been on this so long, i'm running in circles.
Thanks again.

Nov 13 '05 #2
PC Datasheet wrote:
Create a fourth query that includes your three queries. Join Query2 to
Query1 on CustID. Click on the join line and change the join type to the one
that says something like Include all of Query1 and matches from Query2. Join
Query3 to Query1 on CustID. Click on the join line and change the join type
to the one that says something like Include all of Query1 and matches from
Query3.

Create a fifth query that includes the fourth query. Change the fifth query
to Crosstab.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
<ro******@hotmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
greetings. first, i apologize for asking an old question. it appears
that i'm looking for a solution that was already given but it don't
seem to fit my scenario. so thanks for putting up with me.

here's what i have.

a table called "RESULTS" - this table has 4 columns i need to work
with. CustID, Matrix, Test, Parameter.

i have three select queries that perform a count on how many times a
certain "Parameter" is listed.

the first query produces results for all customers (no filtering of
CustID). ** For this message post I'll use the Parameter of "ALUMINUM"
as an example.

so, my first query produces all CustID with Paramter:ALUMINUM appearing
155 times.

my second query (through query design view) filters CustID using; <>
"InHouse". my result for the second query is ALUMINUM appearing 153
times.

my third query (through query design view) filters CustID using;
"InHouse". my resut for the third query is ALUMINUM appearing 2 times.
So my math and three queries are correct.

What I have been trying to do is get ONE query/table that will show a
header with the following; MATRIX, TEST, PARAMETER, Count of Query1,
Count of Query2, Count of Query3.

so that my data row will have; (data for Matrix), (data for Test),
ALUMINUM (aluminum is the data for parameter), 155, 153, 2

the three counts is what is killing me. i can't get the three queries
into one so that i can carry one report instead of three.

This is a long post. I apologize. I'm almost done. Query2 & Query3
which are a subset of Query1 have less data. By this I mean that
ALUMINUM appears on all three but another item like IRON will appear in
Query1 (of course) and Query2 but not in Query3 - or Query3 will show
'0' as a count when all three queries appear side by side (naturally
since there is no "IRON" results for CustID "INHOUSE" generated in
Query3).

I hope i wrote enough detail. I had accomplished this last year but
have lost my original query and the backups on disk. I appreciate the
posts.

I've tried Unions, Crosstabs, Table Creation and then another 4th
query. I've been on this so long, i'm running in circles.
Thanks again.


thanks!
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: jerrygarciuh | last post by:
Hi all, I am iterating through a result set to generate a second set of queries but no matter what I do I get the error Warning: mysql_num_rows(): supplied argument is not a valid MySQL result...
0
by: Clint Pachl | last post by:
When executing multiple queries, which return a result set, must mysql_free_result be called after retrieving each result set using mysql_store_result? My concern is that if the result was not...
8
by: Mike N. | last post by:
Hello: I am new to T-SQL programing, and relativly new to SQL statements in general, although I have a good understanding of database theory. I'm a little confused as to the fundamental...
5
by: WertmanTheMad | last post by:
Ive been playing with this for a few days and thought I might thow it out for seggestions. I have Several Queries that need counts returned The Queries are Mutually Exclusive meaning whatever...
1
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work....
4
by: john | last post by:
I have a about 15 different numbers (which are the result of 15 query calculations (queries on different tables)) which I want to present in a report. What would be the easiest way to get those...
1
by: JosAH | last post by:
Greetings, Introduction This week we start building Query objects. A query can retrieve portions of text from a Library. I don't want users to build queries by themselves, because users make...
1
by: neha02 | last post by:
Hi all, this is my first post here although i've always referred this forum for help. I am trying to design a query based on 4 queries but i'm unable to get the result i want. Please help me-...
9
by: jehugaleahsa | last post by:
Hello: I am writing a cute little class that will cache queries against a database. Currently, I am implementing this by storing the command text, parameter values and generated DataRows. ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.