Wednesday, July 6, 2016

Append 2 tables

Append 2 tables

I'm trying to convert Excel data over to Access.
I have a query like:
SELECT HomesT.Shoveler
FROM HomesT
GROUP BY HomesT.Shoveler
HAVING (((HomesT.Shoveler) Is Not Null));
This generates a list of employees now I need to append these name to tbl_Employees, so I came up with the following
 
INSERT INTO tbl_Employees ( FirstName )
SELECT HomesT.Shoveler
FROM HomesT
GROUP BY HomesT.Shoveler
HAVING (((HomesT.Shoveler) Is Not Null));
But I need to also append related information for each of these entries in another table.  Each of these employees needs to also have the proper responsibility code associated against their EmpId which is the PK of the tbl_Employees.
 
tbl_Employees_Responsibilities:
EmpRespId -> PK, AutoNumber
EmpId -> Generated when the insert occurs per the query above so I need to be able to pass this along dynamically
RespId -> is a number, for this specific case, it would be 2
 
So let's say in my 1st query I append John to the tbl_employees and he get assigned EmpId 394, then I at the same time need to create an entry in the tbl_Employees_Responsibilities for EmpId 394 assigning RespId 2.
How does one do this?
QuestionBoy

Anwsers to the Problem Append 2 tables

Download Error Fixer (Free)

After you run the append query, try running:
INSERT INTO tbl_Employees_Responsibilities (EmpID, RespID)
SELECT DISTINCT tbl_Employees.EmpID, 2 As RespID
FROM HomesT INNER JOIN tbl_Employees
     ON HomesT.Shoveler = tbl_Employees.FirstName
 
Note:  You should only use HAVING when you have a criteria applied to an aggregate expression.  When you use the Totals option in the query designer, for each field with criteria, set the Totals cell for the field to Where whenever the field is not a calculated
field with an aggregate function in its expression.  You can see how this works by switching your original query to SQL view, changing the word HAVING to WHERE and switching back to design view.

To check for Windows updates

  1. Open Windows Update by clicking the Start button Picture of the Start button, clicking All Programs, and then clicking Windows Update.
  2. In the left pane, click Check for updates, and then wait while Windows looks for the latest updates for your computer.
  3. If any updates are found, click Install updates. Administrator permission required If you are prompted for an administrator password or confirmation, type the password or provide confirmation.

Recommended Method to Fix the Problem: Append 2 tables:

How to Fix Append 2 tables with SmartPCFixer?

1. You can Download SmartPCFixer here. Install it on your system. When you open SmartPCFixer, it will perform a scan.

2. After the scan is finished, you can see the errors and problems which need to be repaired.

3. When the Fixing part is done, your computer has been speeded up and the errors have been removed


Related: error message fsui.exe/ wlidcli.dll is missing
,Solution to Error: Excel: Automatic number generation
,Troubleshoot:i wanna change language of all windows in Windows 7 Home Premium
,Troubleshooting:IF Function, if the vendor ID in column A matches any of the vendor ID's in column F, I want 1099 to appear in column D. Error
,Fast Solution to Problem: ReadyBoost is not working properly in my computer
,Troubleshoot:Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive. Error,External Hard Drive not listed in Windows 7 backup wizard Tech Support,Tech Support: I'm always being signed off so annoying,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.,Referencing data in Access using Excel [Anwsered],Need Best Way To Present Data [Anwsered],Same question but for windows 7 home edition,sometimes fullscreen won't activate [Solved],Solution to Error: We bought a new computer with windows 7 and it is constantly freezing. How do we fix this?,Solution to Error: Windows 8 update crash (2013-07-22),brclr.dll.mu_ Missing Error Fixer,How To Resolve Missing fin_myagtui.eng Problem,Corrupted f_0006ad File - How to Fix,nkebigvg.cpl Not Found Error Fixer,Corrupted olcontrols.ocx File - How to Fix
Read More: Solution to Error: Another macro to extract data from multiple sheets question,How to Fix Error - Any fixes for the infamous \"ribbon\" yet??,How to Fix - AMD Radeon HD 7500m\/7600m Series (Microsoft Corporation - wddm v1.20) graphics card problem?,[Anwsered] all programs on the desktop open the windows media center,Troubleshooter of Error: Application Compatibility Tools,After Windows Update CD/DVD drive does not work,After installing windows 7 to laptop the labels print out of line how can I fix it,After my computer sleeps the wireless always disconnects and will no reconnect,After signing into Pogo.com, I get a message" This tab has been recovered"....what does this mean and how do I fix it.....,All desktop icons changed to windows live and does not open

No comments:

Post a Comment