Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sql issue updating values

Status
Not open for further replies.

YoelBenYossef

Programmer
Nov 16, 2005
38
CA
Hi there,
I'm having a problem with one of my updates. I'm using Access to write an epidimeologie assignment, and I start by updating all the date. One of my queries is:

UPDATE tblRecords SET tblRecords.recordsRightAbove = true
where [tblRecords].[recordsMRN]=tblBaseline.[baselineMRN] and tblRecords.recordsRightAbove>tblBaseline.baselineAbove;

However, whenever I run it, I get a box asking me the value of tblBaseline.[baselineMRN]. Strange thing is that I copied and pasted that line of code from a working select statement.

Anyone have any idea what I'm doing wrong?
Eric
 
You have to join the two tables. Use the query builder.
 
are the tables you have on your file is the same you had on the original check that the field or table name is correct and try adding the [] arround the table name as well

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
???? ????? ??

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
You may try this:
UPDATE tblRecords INNER JOIN tblBaseline ON tblRecords.recordsMRN = tblBaseline.baselineMRN
SET tblRecords.recordsRightAbove = True
WHERE tblRecords.recordsRightAbove > tblBaseline.baselineAbove;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top