SQL database question - help

UPDATE PUBLIC_Transaction INNER JOIN ShipTo ON PUBLIC_Transaction.ShipToID ShipTo.ID SET PUBLIC_Transaction.ReferenceNumber = [dbo_ShipTo].[Name] WHERE (((Len([name]))>0))

When I try to run this I get the error message

An Error occurred while executing query: Inccorrect syntax near the keyword ?inner?

We used to have local support that set this up we were able to run it once when it was set up and was told we could re run it when ever we needed to update the infor. Also was told they would send me a new query that would update this info constantly. Never got the email they disappeared along with $1000.00 in pre paid support.

Original goal, in manager under a specific customer in the purchase history tab to have the Customer name from the ship to tab appear in the Reference # field in the purchase history tab, by doing this i can look up purchase history for the ship to customer under a specific account ie; XYZ Toll , shipped to Joe Smith, Question what did Joe Smith Purchase on Last visit, go to XYZ Tool click on Purchase tab under Reference # find Joe Smith, Click on Trans# and view reciept from last purchase.

Any help would be appreciated

Reply to
shoeman240
Loading thread data ...

You will want to something like this, I haven't tested the results of the query so give it a try on a non-live db, also make sure you do a backup before performing any query that makes changes to a live db.

UPDATE [Transaction] SET [Transaction].ReferenceNumber = ShipTo.[Name] FROM [Transaction] INNER JOIN ShipTo ON [Transaction].ShipToID = ShipTo.ID WHERE Len([name])>0

Rob

"shoeman240" wrote:

Reply to
Rob

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.