Rabu, 21 Desember 2011

RE: [MS_AccessPros] Append query question

 

INSERT INTO tblEmployeeLabels ( [Person Id], [Jobcode Ld], [First Nm], [Last
Nm], [Dept Id], [Dept Ld] )
SELECT tblEmployeeLabelsTempEmployees.[Person Id],
tblEmployeeLabelsTempEmployees.[Jobcode Ld],
tblEmployeeLabelsTempEmployees.[First Nm], tblEmployeeLabelsTempEmployees.[Last
Nm], tblEmployeeLabelsTempEmployees.[Dept Id],
tblEmployeeLabelsTempEmployees.[Dept Ld]
FROM tblEmployeeLabelsTempEmployees LEFT JOIN tblEmployeeLabels ON
tblEmployeeLabelsTempEmployees.[Person Id] = tblEmployeeLabels.[Person Id]
WHERE tblEmployeeLabels.[Person ID] IS NULL;

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Waco, Texas <yee haw>)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of luvmymelody
Sent: Wednesday, December 21, 2011 1:26 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Append query question

Hello all,

I have an append query that runs on the OnOpen event of a form. The query named
qryAppendtblEmployeeLabelsTempEmployees, appends any temp employees to a local
table. But if a user opens the form multiple times the query continually appends
the table with any temp employees over and over. I added the tempemployee table
to the append query and tried every join to get it to work. I have added Is
Nulls and is not nulls to the criteria and nothing is working. I am having a
brain freeze on this one. Here is the current raw sql statement. What have I
missed?

Thank You so much for the help.

Jim Wagner

INSERT INTO tblEmployeeLabels ( [Person Id], [Jobcode Ld], [First Nm], [Last
Nm], [Dept Id], [Dept Ld] )
SELECT tblEmployeeLabelsTempEmployees.[Person Id],
tblEmployeeLabelsTempEmployees.[Jobcode Ld],
tblEmployeeLabelsTempEmployees.[First Nm], tblEmployeeLabelsTempEmployees.[Last
Nm], tblEmployeeLabelsTempEmployees.[Dept Id],
tblEmployeeLabelsTempEmployees.[Dept Ld]
FROM tblEmployeeLabelsTempEmployees INNER JOIN tblEmployeeLabels ON
tblEmployeeLabelsTempEmployees.[Person Id] = tblEmployeeLabels.[Person Id];

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar