473,394 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

update blank table record field

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
6 2768
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Bob M | last post by:
Hi all, I am trying to update a record with a function value. Here is the function: update ITSM_SER_CUSTOM_FIELDS set SCF_SCDATE2 = SLA_PENDING_DATE.GET_DL(2292,'servicecall') where...
1
by: Robert | last post by:
How can I query an existing table and update a field in each record in the table with the occurrence count of each record e.g. update field to 1 (= first record occurrence), update field to 2 for...
6
by: Robert | last post by:
Hello, Accessors What I would like to do is create a multi-record table update. I have a table and a form for it. I want to modify it so that there is a new field (textbox) (not bound to a...
5
by: Maxi | last post by:
I have 162 tables in my database. Names of the Tables are 1, 2, ...... so on till 162. Every table has only one field (field name = Expr2) of type NUMBER (DOUBLE) with 352716 records in each table....
8
by: Maxi | last post by:
There is a lotto system which picks 21 numbers every day out of 80 numbers. I have a table (name:Lotto) with 22 fields (name:Date,P1,P2....P21) Here is the structure and sample data: ...
2
by: Brett | last post by:
My database has 2 tables: Table1 & Table2. If a field is not null on a record in table2, then the not null fields in table1 that correspond to the records in table1 needs to be updated to match the...
4
by: sparks | last post by:
I am trying to fix a database that someone did about 4 yrs ago in access97. The main table just contains demographics and is on the main form of the database. It has a subform on a tab that...
1
by: hmlarson | last post by:
I have a form/table with checkboxes that I would like the user to check / uncheck if they want a certain record to display in a gallery on a website. I'm having problems figuring out how to...
1
by: afromanam | last post by:
Hello, Good morning, I have a question, hope someone can help me. I have a table with say, 5 columns, each named A,B,C,D,E The table was imported from Excel, so picture please this:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.