Link to home
Start Free TrialLog in
Avatar of Chris Michalczuk
Chris MichalczukFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Sql 2000 syntax issue with updates and joins

trying to update a field as shown below but got all my joins wrong in this syntax!!!
also how would I add a variable into the set statement which picks up today's date in uk format
eg set field  = '13/10/2011 - test'   i want the 13/10/2011 to change based on today's date

UPDATE    tbl_Inventory
SET              tbl_Inventory.Inventory_ManufacturerSN = '13/10/2011 - test'  
FROM         triscan_licencing.dbo.OdysseyPartsMasterView xx

INNER JOIN
                      tbl_Jobs ON tbl_Inventory.Inventory_ID = tbl_Jobs.Jobs_ParentInventoryID INNER JOIN
                      triscan_orders.dbo.tbl_OrderLines yy ON yy.OrderLines_ID = tbl_Inventory.Inventory_OrderLineId
WHERE     xx.PN = tbl_Inventory.Inventory_PartNumber AND (xx.version IS NOT NULL) AND inventory_ID = 118386 AND yy.Orderlines_Paid = 0
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

update with join: here is my article about that:
https://www.experts-exchange.com/A_1517.html
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
bhess1,

 I found that actually, the table you update does not need to be in the from list ...