By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,699 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,699 IT Pros & Developers. It's quick & easy.

update blank table record field

P: n/a
Hello-

I have a table (tblCalls) where I import call stats from an
application to. The table has fields: CallID, EmpID, EmpName,
CallDate, TotalCalls, etc, etc.

On the import process I use all fields except CallID & EmpID. The
CallID field is ok as it is the autonumber field in the table. But I
don't use the EmpID field in the import so it is left blank in the
table after importing call stats.

There is a table (tblEmployees) which has EmpID and EmpName as well.
How would I use a query or something else to get the EmpID field to
populate based on the value of the EmpName of the record?

Any help is greatly appreciated.
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies

P: n/a
IF your EmpName uniquely identifies a record in tblEmployees (in which case,
why bother with an EmpID?), you could run an Update Query like this:

UPDATE tblCalls INNER JOIN tblEmployees ON
tblCalls.EmpName=tblEmployees.EmpName SET tblCalls.EmpID=tblEmployees.EmpID

HTH
- Turtle

"Scott Sabo" <ss***@henryschein.com> wrote in message
news:82*************************@posting.google.co m...
Hello-

I have a table (tblCalls) where I import call stats from an
application to. The table has fields: CallID, EmpID, EmpName,
CallDate, TotalCalls, etc, etc.

On the import process I use all fields except CallID & EmpID. The
CallID field is ok as it is the autonumber field in the table. But I
don't use the EmpID field in the import so it is left blank in the
table after importing call stats.

There is a table (tblEmployees) which has EmpID and EmpName as well.
How would I use a query or something else to get the EmpID field to
populate based on the value of the EmpName of the record?

Any help is greatly appreciated.

Nov 12 '05 #2

P: n/a
I get a sytax error when I try the recommended UPDATE query: syntax
error (missing operator) in query expression 'tblCalls.EmpName=T
Employees.EmpName'.

Any ideas?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

P: n/a
The syntax I recommended was
tblCalls.EmpName=tblEmployess.EmpName

HTH
= Turtle

"Scott Sabo" <ss***@henryschein.com> wrote in message
news:3f*********************@news.frii.net...
I get a sytax error when I try the recommended UPDATE query: syntax
error (missing operator) in query expression 'tblCalls.EmpName=T
Employees.EmpName'.

Any ideas?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #4

P: n/a
Scott Sabo <ss***@henryschein.com> wrote in message news:<3f*********************@news.frii.net>...
I get a sytax error when I try the recommended UPDATE query: syntax
error (missing operator) in query expression 'tblCalls.EmpName=T
Employees.EmpName'.

Any ideas?


open the query in design mode, click the dropdown on the top left to
switch to SQL view, and post the SQL so we can see it... What's the
T in there for?
Nov 12 '05 #5

P: n/a
The two tables in question are actually tblCalls and T Employees. The
employees table was an original table in the database befor I was
taught about naming conventions. Anyway, the SQL I have after
adjusting it is:

UPDATE tblCalls INNER JOIN T Employees ON
tblCalls.EmpName=T Employees.EmpName SET tblCalls.EmpID=T
Employees.EmpID

And this gives me the syntax error:

syntax error (missing operator) in query expression
'tblCalls.EmpName=T
Employees.EmpName'.
Nov 12 '05 #6

P: n/a
It's usually a bad idea to use spaces in table names (although Access does
allow it).
Enclose the name in square brackets whenever you use it in code or SQL:

UPDATE tblCalls INNER JOIN [T Employees] ON
tblCalls.EmpName=[T Employees].EmpName SET tblCalls.EmpID=[T
Employees].EmpID

HTH
- Turtle
"Scott Sabo" <ss***@henryschein.com> wrote in message
news:82*************************@posting.google.co m...
The two tables in question are actually tblCalls and T Employees. The
employees table was an original table in the database befor I was
taught about naming conventions. Anyway, the SQL I have after
adjusting it is:

UPDATE tblCalls INNER JOIN T Employees ON
tblCalls.EmpName=T Employees.EmpName SET tblCalls.EmpID=T
Employees.EmpID

And this gives me the syntax error:

syntax error (missing operator) in query expression
'tblCalls.EmpName=T
Employees.EmpName'.

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.