473,758 Members | 5,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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:ALUMIN UM 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 1632
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******@pcdata sheet.com
www.pcdatasheet.com
<ro******@hotma il.com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.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:ALUMIN UM 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******@pcdata sheet.com
www.pcdatasheet.com
<ro******@hotma il.com> wrote in message
news:11******** *************@z 14g2000cwz.goog legroups.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:ALUMIN UM 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
3675
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 resource even though if I echo the query to the browser and cut and paste it into the command line I get valid results.
0
1555
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 freed after each retrieval, that perphaps it may impose a memory leak. Or, does MySql reuse previously allocated memory for subsequent result sets? My app performs several back-to-back select and select/insert queries. Just need to know how to...
8
15234
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 differences between a view and a query, or rather, when it is more appropriate to use one vs. the other. It seems to me that most select queries can be implemented as views, and I can't see the downside to doing so.
5
3719
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 Query they return in first they cannot be included in the counts of any queries below them. This set of queries for example
1
2829
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. Despite entering the required lines to "my.ini" (the new my.cnf) through notepad AND MySQL Administrator, the cache does not work. So, today I took a peek at the 'Health' tab in MySQL Administrator.
4
1324
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 values from the query into one report? I don't seem to be able to base a report on more than one query. I'm rather new to Access and I have no VB experience so I hope it can be done without it. Thanks, john
1
4436
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 mistakes. Instead, the Library hands out queries to the user given a simple query String. This is how the library does it:
1
1383
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- I have this data in a table console – Cust_id Date Amt Category 1111 10/10/07 10 1
9
3649
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. First of all, is there something that does this already? Second, right now I use a struct called Result that looks like this:
0
9298
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9885
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6562
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3829
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 we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.