473,498 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access VBA: how to create crosstab table using two queries

11 New Member
hi,
I have two queries, named:
1. Q1, which has columns name
Mgr ID, MGR_Name, Empl_ID, Empl_Name, Years_of_Service

and
2.Q2 which has
MGR_ID, EE count

both queries have 1:1 relationship for MGR_ID

Using this two queries, I'd like to output a table like this:



The empl_name with respective MGR_ID will be automatically feed to columns named GAR1 until GAR 6 and the respective years_of_service will be feed to GAR 7 - GAR 13 columns accordingly.

Can anyone help me?
Sep 2 '10 #1
6 1960
kadghar
1,295 Recognized Expert Top Contributor
have you tried using Docmd.RunSQL?:

Docmd.RunSQL "Select MGR_ID from Table1 where ..."
Sep 8 '10 #2
miss D
11 New Member
not yet..
how can i do that?
can u help me with the code?
i am a newbie in vba..
Sep 14 '10 #3
kadghar
1,295 Recognized Expert Top Contributor
just like i told you above.

The tricky part here is doing the SQL for showing the count and other columns, since SQL with count willo only show you the counted column, so make 2 SELECT and merge them.
Sep 14 '10 #4
miss D
11 New Member
for the count part, i have no problem
as i already generate the query to count number of employee that manager has.



the problem is how do I define my own column named GAR 1 until GAR 6 to feed the employees names. followed by GAR 7 untill GAR 12 for years of service for respective employees.
Can u help me?

Thanks in advance
Sep 14 '10 #5
kadghar
1,295 Recognized Expert Top Contributor
mmm, i see. That's a hard one, why dont you try asking in the MySQL or SQL Server forum?
I'm sure the guys there will give you a better SQL command.
Sep 14 '10 #6
miss D
11 New Member
alright.
thanks for your replies :)
Sep 14 '10 #7

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

Similar topics

1
2052
by: Michael Hardy | last post by:
I would like to reopen this discussion. I need to create this table using SQL that will return this dataset. BRAID RATEDEFID MIN(BRADATE) MAX(BRADATE RATECODE PRODNAME 614 14 12/1/2002...
2
5694
by: Laphan | last post by:
AAAAARRRRGGGGHHHH!!! Everything appears to be great in doing a web-based editor using the execCommands apart from the fact that there is no method to insert a table. I've seen somebody suggest...
4
68630
MMcCarthy
by: MMcCarthy | last post by:
The following code is simply an example of some code that processes through two recordsets. It can be helpful for anyone curious as to how to start processing with recordsets (Which objects to refer...
1
6758
by: rdeanstew | last post by:
I have created a query and saved it. The Access 2003 allowed me to create a table using the query. To the life of me I can't find out where to do this in A2007. Can someone either answer this or...
2
2418
by: lakuma | last post by:
Hi, I have a table called A (say) with columns called name, place, animal and thing. I would want to write an on insert trigger on this table, which would create a table with the name of the...
1
5994
by: huntress | last post by:
I am trying to create pivot tables using VBA in Access 2003. Is this possible? How do I go about it?
0
1416
by: cb123 | last post by:
Hello, Please bear with me I'm new to t-sql. I've had no luck trying to figure this out yet using sql code. I need to use an existing table (data dictionary) as input for creating a new table. ...
0
1036
by: lenygold via DBMonster.com | last post by:
I have a following summary table: DISP_ID CLAIM_TYPE ERROR_CODE FILE1_TOT FILE2_TOT -------- ----------------------- ------------------------- ----------------- -- ...
32
23335
by: redman08 | last post by:
I have produced an Excel (2007) worksheet, with which I want to create a Pivot Table. This would all be done from a module run on an Access 2007 database. Please can anyone supply some simple...
6
3131
by: nicolenwn | last post by:
Hi everyone(: I'm having trouble creating pivot tables using macros. First i tried recording it then running the exact same thing. It worked fine the first time but a week later when i tried...
0
7002
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...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6885
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
7379
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
4588
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
3093
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
3081
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1417
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 ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.