[SQL Server] 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 |
You are subscribed to email updates from SQLServerCentral / SQL Server 2008 / SQL Server Newbies To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
No comments:
Post a Comment