Multiple Query Report- Really Need HELP!

I have 3 queries

1.) Count of Employee ID by Department  - table 1

2.) Count of Employee ID by Category - Table 3

3.) Count of Employee ID by Final Action Table 3

These three queries all have a count on the employee id. I would like to put 
them all on 1 report instead of three separate reports. I have done some 
researching, but not found comprehensive instructions on how to do a union 
query. So far I've been able to combine the employee id numbers, but its no 
help since dept is in one table and category & final action are in 
another...am I missing something?

One thing to note is that Table 2 pulls from Table 1 so it is not needed 
except to filter specific selected employees. Table 1 is a database of all 
employees.
0
Utf
1/13/2010 11:36:01 PM
access.queries 6343 articles. 1 followers. Follow

2 Replies
692 Views

Similar Articles

[PageSpeed] 23

Try this --
SELECT "Department" AS Data_Item, [Department], Count([Employee ID]) AS Tally
FROM [Table 1]
GROUP BY "Department", [Department]
UNION ALL SELECT "Category" AS Data_Item, [Category], Count([Employee ID]) 
AS Tally
FROM [Table 3]
GROUP BY "Category", [Category]
UNION ALL SELECT "Final Action" AS Data_Item, [Final Action], 
Count([Employee ID]) AS Tally
FROM [Table 3]
GROUP BY "Final Action", [Final Action];

-- 
Build a little, test a little.


"Charess" wrote:

> I have 3 queries
> 
> 1.) Count of Employee ID by Department  - table 1
> 
> 2.) Count of Employee ID by Category - Table 3
> 
> 3.) Count of Employee ID by Final Action Table 3
> 
> These three queries all have a count on the employee id. I would like to put 
> them all on 1 report instead of three separate reports. I have done some 
> researching, but not found comprehensive instructions on how to do a union 
> query. So far I've been able to combine the employee id numbers, but its no 
> help since dept is in one table and category & final action are in 
> another...am I missing something?
> 
> One thing to note is that Table 2 pulls from Table 1 so it is not needed 
> except to filter specific selected employees. Table 1 is a database of all 
> employees.
0
Utf
1/14/2010 12:20:01 AM
On Wed, 13 Jan 2010 15:36:01 -0800, Charess
<Charess@discussions.microsoft.com> wrote:

>I have 3 queries
>
>1.) Count of Employee ID by Department  - table 1
>
>2.) Count of Employee ID by Category - Table 3
>
>3.) Count of Employee ID by Final Action Table 3
>
>These three queries all have a count on the employee id. I would like to put 
>them all on 1 report instead of three separate reports. I have done some 
>researching, but not found comprehensive instructions on how to do a union 
>query. So far I've been able to combine the employee id numbers, but its no 
>help since dept is in one table and category & final action are in 
>another...am I missing something?
>
>One thing to note is that Table 2 pulls from Table 1 so it is not needed 
>except to filter specific selected employees. Table 1 is a database of all 
>employees.

A UNION query is pretty simple: you need two (or three, or more) queries which
return the same number of fields of matching datatypes. Assuming that your
three count queries consist of a text field (Department, Category, Final
Action respectively) and a number, you can open the SQL window and type in

SELECT [Department] AS Fieldname, CountOfEmployeeID FROM qryDept
UNION ALL
SELECT [Category], CountOfEmployeeID FROM qryCat
UNION ALL
SELECT [Final Action], CountOfEmployeeID FROM qryAct

You can add other fields (the fieldnames don't matter) just so they pair up:
number with number, date with date, text with text.

Alternatively you can put three Subreports on one Report.
-- 

             John W. Vinson [MVP]
0
John
1/14/2010 12:39:50 AM
Reply:

Similar Artilces:

Create a list with multiple criteria
I have a data base with 1,000's of addresses w/zipcodes (Sheet 1 columns A to E, E being zipcodes). After setting a base address I get all of the zipcodes within a given radius (in this case 70 zipcodes), listed in Sheet 2, Column A. Next, I use COUNTIF (in column B) to find how many addresses are in each zipcode, in this example there are 46 addresses within the 70 zipcodes. What I want to do is create a list in sheet three that will list each with the data from Sheet 1 columns A to E). Any help would be appreciated. Ronbo ...

Passing info to a Report
Hey all, with a new version of Office once again comes a question from me about adjusting my coding. I'm still very much new to learning the Visual Basic language so bear with me if you find the answer to be blantantly obvious. :-) Here is my code as is: Private Sub cmdPrintInvoice_Click() On Error GoTo Err_Handler DoCmd.RunCommand acCmdSaveRecord Dim strReportName As String Dim strCriteria As String strReportName = "rptInternationalInvoice" strCriteria = "[InvoiceID]=" & Me![InvoiceID] DoCmd.OpenReport strReportName, acViewP...

Removing multiple hyperlinks
I've got data copied into my spreadsheet that includes hyperlinks. Ther are thousands of these in a column. I can remove individually by right-clicking and selecting Hyperlink an Remove. I can then arrow down and do a control Y, cell by cell, What I want to do is highlight the column and be able tp remove th hyperlinks all at once. I've exhausted myself peering through knowlegebases and groups, bu cannot find any way to make this work. Thanks for any input you can provide -- Message posted from http://www.ExcelForum.com Hi one way: Use the following macro to remove hyperlinks...

FRX report modification
I have an FRx report that I am attempting to add a "Budget" column that will combine the budgets from 3 seperate companies and add them together. I have the calculated formula that is COMPANY A + CompanyB + CompanyC to give me the total. I can see the budget values for CompanyA and CompanyB but No values are displaying for Company C. I am trying to investigate why the values are not there and not sure where to start the investigation process 1. Make sure budget ID for each column actually exits in the corresponding company. 2. Make sure each column is pointing to the corresp...

Charting multiple multiples
Hopefully I can explain this in a way that will be understood. Data: Place A Place B Place C FWD Back FWD BACK FWD Back Org_1 1 2 3 2 1 3 Org_2 2 5 4 6 1 4 I would like to place the data so that FWD and Back data is stacked on top of each other in different colors, and placed in one row on a 3-D chart as Org-1 and a second row as Org_2. Any ideas? Thanks. If you arrange your data like this: Back FWD Org_1 Place A 2 1 Place B 2 3 Place C 3 1 Org_2 Place A 5 2 ...

Still need help
I have a spreadsheet that is 3604 rows & 6 columns. Column E has only hyperlinks to URL's. I have filtered my data via column B. I tried to A-Z Column A. When I do, the hyperlinks do not stay with the data. The mask looks correct but when you scroll over the hyperlink you see a completely different URL.????? Can anyone tell me how to make sure the Hyperlink keeps the correct URL when filtering and sorting the data. "Tim Williams" wrote: > Try using the =HYPERLINK() worksheet function Thanks Tim for answering, hoping you're still there. I tried it and i...

Multiple Hyperlinks In Same Shape Doesn't Work
Can anyone tell me how I can get multiple hyperlinks in the same shape to work? I have no problem inserting the hyperlinks, but they all point to only one. I scoured these posts, and found this (http://groups.google.com/groups?q=hyperlink+group:microsoft.public.visio.*&hl=en&lr=&ie=UTF-8&oe=UTF-8&group=microsoft.public.visio.*&selm=3eea6467%241%40news.microsoft.com&rnum=2), which doesn't appear to work. Thanks in advance-- RAD Um, which version of Visio are you using? As far as I know, at least Visio 2002 and Visio 2003 support multiple hyperlinks. Can't...

Can't not access CRM Crytal Report
Hi All, when I try to access any Reports(Sales , Service , and Admin reports) , an error message appear "Crystal Reports Logon Error Please verify that you have enough Crytal Licenses". I am using windows server 2003. According microsoft technical support help, the error can cause by user authority, that I have to add NT Authority, etc. But, I don't know how to configure this on Windows server 2003. Does any one can help me ? Or may be, any other solution to solve ? Also, in the next time I want to customize report. Do I have to use Crystal Reports 9.2.2. Because, when I try t...

Multiple Profiles, multiple accounts, multiple machine configuring?
Is there a vb or related method of adding *both* profiles *and* email accounts to multiple users logins from the administrator account? I have a network which is a workgroup (NOT a domain), in which there are about 15 users that are replicated on each of 5 machines. I'd like to be able to add all 15 Mail Profiles, and all 15 email accounts to each of the 15 logins on these 5 machines--obviously with as little work as possible. The mail is all retrieved from the same Exchange Server, but these machines *cannot* be added to a domain (don't ask!). I'd hate to have to log into ...

Date in the query is always short date
I want to capture the LONG date from a query, so I create a parameter for the date (mm ddd yy) . In its properties, it's format is long date, BUT it always shows up the short date. WHY? Dates are stored as decimal number counting days from 12/31/1899 midnight with time as the decimal fraction of a day. Formats are just different ways to display the information. So you got to set the format. In design view of the query click the field of the grid that has the datetime field, right click, scroll down and select Properties. Click 'Format' and then in the pull down...

DAP query question
I have a bunch of data access pages set up. Working showing the data for a particular data. I have new plans and need to have a date range choosen by a user on the page itself, then that data to be shown for the entered range. so the query would be a select query summing with the date criteria being between [startdate] and [enddate] problem is how do i either create a calendar control or two drop downs on the page itself that the user can change to view the nessisary data. Im assuming a command button will also be needed. is there a way to pass the values from controls on a dap to the que...

distributing data into multiple cells
hii i have to prepare an exel sheet of some 2000 products..i have to copy d data from the net and then prepare the sheet,with 4 different columns for 4 diff types of entries..now when i copy data nad paste is as text.it all goes in a single cell in a row .how can i distribute the data l into multiple cells????????? -- jaspreet ------------------------------------------------------------------------ jaspreet's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=23821 View this thread: http://www.excelforum.com/showthread.php?threadid=374772 can you show some samp...

Single click selects multiple cells
When clicking on a single cell multiple cells are selected. The one time solution for this is to zoom in or out. This is problematic as 60% seems to be the zoom that works most of the time but at this zoom level the cell contents do not display. The time lost and the frustration that builds is killing my productivity and office attitude. Please give all of us a permanet fix. -- Thanks Mike ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" butt...

Is there a way to sort multiple columns with a tab or something?
I have a 4 column spreadsheet. I want to be able to click the heading for each of the columns to hav them sort by that column if clicked. How do I do that -- Message posted from http://www.ExcelForum.com Hi why not used the soprt icon for this. Note: This could screw up your sorting if Excel does not recognize your database columns correctly -- Regards Frank Kabel Frankfurt, Germany > I have a 4 column spreadsheet. > > I want to be able to click the heading for each of the columns to have > them sort by that column if clicked. How do I do that? > > > --- > Mess...

Really easy question
I know that this must be a very basic question but I just can't find the answer to it in excel help. When I am typing in a cell how can I force excel to start a new line without tabing the word to the end of the current cell. i.e. This is what I get Mr Jones 25 Freemount Street Potter Bar End and this is what I would like Mr Jones 25 Freemount Street Potter Bar End Apologies for the really silly question. Thank you rit...@hotmail.com wrote: > When I am typing in a cell how can I force excel to start a new line ALT+ENTER On 31 Oct 2005 22:21:24 -0800, "Bucky" <u...

Need help building query
I'm not that familiar to Access and would appreciate some help building the following SQL query. I have two tables, and if two categories match within the tables, then I would like a third category entry updated to the first table. 1st Table: Working 2nd Table: Original Categories (columns) that should match between table 1 and 2: Pt Acct # Charge Cd If the entires for a line match, then update: Lawson # (take from Original table and enter into line for Working table) So, basically if the (Pt Acct #) AND (Charge Cd) in the (Original) table match the (Pt Acct #) AND (Charge Cd) in...

Sending to multiple addresses
How do I send an email to multiple addresses having only the recipient see their own email address? Michelle wrote: > How do I send an email to multiple addresses having only > the recipient see their own email address? Put the addresses into the BCC: field. Note that many e-mail programs will decide such mails are spam though. >-----Original Message----- >How do I send an email to multiple addresses having only >the recipient see their own email address? >. Open your new email and go to tools, select recipient, when your address book opens select (highlight) the a...

Some basic reporting fields
1. Daily Sales by register, the register number field was "filter value invalid" why is this when i am putting in the right register number? 2. How can i pull a daily sales but when i try to input a date in the date field, it is not giving me that particular date? It is saying that a numeric field is required. I put in it as 10/21/2005 and this is the format, so i do not understand why this is happening? 3. In the detail sales report, every item is listed even if that item is sold 10 times, it shows up 10 times, how can i get a summary of the detail sales. The summary sales rep...

multiple selection
How can I select multiple records into a list box? I want that for append identical records (for select records) in another table. Many thanks Florin Use a subform instead of a list box. In a subform bound to a related table, you can append as many rows as applicable. It is possible (but not simple) to use an unbound multi-select list box that is populated in the Current event of the form, and executes Append, Delete, and Update query statements based on the ItemsSelected if they are changed. You will also have to find a way to respond to the user "undoing" changes. -- Al...

Exchange 2000 Distribution Lists
Hello We are running an Exchange 2000 environment in Exchange Native Mode and Windows Mixed Mode. We just converted from Exchange 5.5 Is there any way to configure multiple people to be owners or editors of the distribution lists? This was possible in 5.5, but we cannot find a means of accomplishing this in 2000 Any help would be appreciated Thank yo Jason "Jason P.S." <jason.pruden-shebaylo@investorsgroup.com> wrote: >We are running an Exchange 2000 environment in Exchange Native Mode and Windows Mixed Mode. We just converted from Exchange 5.5. > >Is there any w...

Need to have a dropdown list containing multiple rows
I am setting up an form and need to create a dropdown list that will contain 8 sets of data. Each set needs to contain 3 rows of data (name, street address & city/state/zip. The goal is to allow the user to click onto the cell, see the dropdown and select which address set to use. This would then place the data into three rows suitable for mailing. I have never attempted anything like this and am in need of assistance. Thank you. --- Message posted from http://www.ExcelForum.com/ Pat What you ask is easily done using Data Validation drop-down list and a few Vlookups but........Ex...

Combine multiple tables into one
I took over a database in which the last person created a new table for everyday worth of data (ie. Feb-21-08 is named 022108). There are over 100 tables in the single database with the same columns and table attributes, I would like to combine all of these tables into one where I have a Date_Key field in place of the table name. I figured out how to query the table names using the following: SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],1)<>"~") AND (Left$([Name],4) <> "Msys") AND (MSysObjects.Type)=1 ORDER BY MSysObjects.Name; Now I j...

Multiple domains #6
Hi, Having done some research I have found that it is possible to send and receive email from multiple domains with Exchange 2003. I have a few questions that I would like cleared up if anyone can help. 1. Is it really as simple as configuring a recipient policy for the new domain and then changing the mail record for that domain to point to the proper IP address? 2. If I set up a new account in AD, and need this account to be associated with the second email domain, will the default SMTP email be for the first domain? If so, can I just edit this directly? 3. If I set the default SMTP add...

Desperately need a way to run Internet Explorer 7 in 2008 R2
We just installed thin clients at a car dealership using Server 2008 R2. We did not find out until afterward that one major site (www.bzbuzztrak.com) will only run on Internet Explorer 7. After 3 hours of trying workaround for the site, I gave up. Unfortunately this is somewhat of a deal breaker and we need to get this working. Is there any way - even radical way- that we can run Internet Explorer 7 with those thin clients. BTW, I did try all the software that will allow you to run multiple instances of IE, but none work. You can run IE8. I am running it on a W2K3 Enter...

Help Regarding an update query
Hi, iam trying to run an update query. the situation is as follows, i have linked excel sheets in my table. so i am using the update query to update all the records that i have them in my access tables. i tried this before many times and i was successful in doing that. But in some tables, it gave me an error message "Type mismatch in expression". i checked each and every field in my access table and in the excel sheets and they are all with the correct format. any help?? any ideas? On Fri, 31 Aug 2007 08:47:16 -0700, Samer <samoora44@gmail.com> wrote: >Hi, iam trying to r...