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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query

Status
Not open for further replies.

flynbye

Programmer
Nov 16, 2001
68
US
Seems like this should be easy enough to do and based on the SQL examples that I've seen following should be correct. I have 2 tables one is tblProgressBillingDetails and another which I want to update with values from the table above called tblBillingDetails. When I run the update no values are updated in the tblBillingDetails table?

Statement is:
UPDATE tblProgressBillingDetails INNER JOIN tblBillingDetails ON tblProgressBillingDetails.ProposalDetailsID = tblBillingDetails.ProposalDetailsID
SET tblBillingDetails.TotalBilled = [tblProgressBillingDetails].[BillingAmount];

Any help hugely appreciated (starting to think that perhaps more sleep would help this issue) :)
 
Will this work:

UPDATE tblBillingDetails
SET [tblBillingDetails].[TotalBilled] = [tblProgressBillingDetails].[BillingAmount]
WHERE tblBillingDetails.ProposalDetailsID IN (
SELECT tblProgressBillingDetails.ProposalDetailsID FROM tblProgressBillingDetails)
Terry M. Hoey
 
erm, looks like you're trying to update the wrong table.

UPDATE tblBillingDetails INNER JOIN tblBillingDetails ON tblProgressBillingDetails.ProposalDetailsID = tblBillingDetails.ProposalDetailsID
SET tblBillingDetails.TotalBilled = [tblProgressBillingDetails].[BillingAmount];

HTH
 
Thanks guys... actually more sleep could have helped... :)

That Update To field in the design screen always throws me off and after tinkering with it for a bit (ok more like couple of hours) was able finally to slap my self in the forhead and do the "DUH!" thing... hehe...

Appreciate the assist.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top