Monday, October 14, 2013

[SQL Server] How to update theese records?

[SQL Server] How to update theese records?


How to update theese records?

Posted: 13 Oct 2013 10:46 PM PDT

Hi All!I have this Query:select * from dbo.dutyrostershift A join dbo.timeaccountmovement B ON B.ownerid = A.idwhere( A.fromtime <> B.starttime or A.totime <> B.endtime)And B.timeaccountid = 12AND A.std = 1AND B.ownertype = 1Basically, it finds records which has mismatched start and endtimes - they should be indentical in dbo.dutyrostershift and dbo.timeaccountmovement in the pairs where the ownerid in dbo.timeaccountmovement is equal to the ID in tdbo.dutyrostershift.The Query finds the records correctly.From here, it should be simple to update dbo.timeaccountmovement with the correct values from dbo.dutyrostershift, but I must admit, that iI have not found out how yet. Any WHO can/will help?Best regardsEdvard Korsbæk

No comments:

Post a Comment

Search This Blog