473,387 Members | 1,536 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,387 software developers and data experts.

Union Query with Count Function

greeni91
Hi,

I am currently trying to create a report that list all the Features that have been checked and the metrology used to check said feature.

I have created a UNION query that will combine the fields used in my form into one column in a query. The problem I face is that if there are any duplicates in my UNION query they are combined but I do not know how many times that combination has appeared.

I am needing a Count function added to my query that will tell me how many times the combination of Feature and Metrology have been used.

Here is a copy of my SQL statement below. I have followed a few guides on the internet for this topic but cannot get the results I need.

Any help is greatly appreciated.

Expand|Select|Wrap|Line Numbers
  1. SELECT [Feature 1] AS Feature, 
  2.              [Metrology Used 1] AS Metrology
  3. FROM tblFirstOff
  4. UNION
  5. SELECT [Feature 2],
  6.              [Metrology Used 2]
  7. FROM tblFirstOff
  8. UNION SELECT [Feature 3],
  9.              [Metrology Used 3]
  10. FROM tblFirstOff;
  11.  
Regards,

Greeni91
Feb 21 '13 #1
1 1579
Rabbit
12,516 Expert Mod 8TB
Use union all. That preserves duplicates.
Feb 21 '13 #2

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

Similar topics

0
by: s_gregory | last post by:
The mdb is considerable size 70 +- mb. A complex union query was working well, but when an additional union select... was added into the query, selecting identical fields from a different source,...
1
by: M Stery | last post by:
Using Transfer Text macro to create comma-delimited file of the results of union query. Underlying queries use \(999") "999\-9999! to format area code/phone number and work fine, but once the...
4
by: Mark | last post by:
Hi all, I am currently in the design stages of a database for work. I have come up with a way to get informaion I need using a union query but was wandering what effects this will have on...
1
by: turtle | last post by:
I need to get the results of two queries into one. I need all the data from both queries (i guess this is a full join or outer join). Can I do a union query. Query1 Job Budget ...
2
by: mattytee123 | last post by:
I have about 20 tables, of which I would like to do a union query and count of how many of each different code there is? The simplified verson of the table is structured like this. Code ...
3
by: NoodNutt | last post by:
G'day ppl. Can anyone assist me with the correct structure of the following in a Union Query. tblBookings.FinYear tblBookings.DepPrefPay tblBookings.IntPrefPay tblBookingsFinPrefPay
1
by: forey | last post by:
Hi All, I'm trying to find the best way to accomplish the following: I have a union query in an Access XP database (pasted below) SELECT Contacts.Company,Contacts.dba, Contacts.Misc1,...
1
by: BerkshireGuy | last post by:
I have the following union query: SELECT Count(PolicyNumber) AS TotalSubmitted, "TOTAL SUBMITTED" as Header, "Combined" as TelemedClass, "1" as GroupA,"1" as Postion FROM tblAppActivity WHERE...
1
by: Starke | last post by:
I have a table where Im counting records that have a two certain criteria. My Question is, If one criteria is met, but the other isnt instead of not retrieving the record can the count value...
27
by: MLH | last post by:
How can I turn the following into a make-table query? SELECT & " " & AS Recipient FROM tblVehicleJobs INNER JOIN tblAddnlOwnrs ON tblVehicleJobs.VehicleJobID = tblAddnlOwnrs.VehicleJobID WHERE...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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...

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.