Update statement help please!

  • Hi guys!

    I have written this SQL statement, which works for Access, but I can't work out the equivalent for SQLServer.

    UPDATE tblMsgImp INNER JOIN tblMsgImp AS tblMsgImp_1 ON tblMsgImp.MID = tblMsgImp_1.MID

    SET tblMsgImp.MImp = [tblMsgImp_1].[MImp], tblMsgImp.MNote = [tblMsgImp_1].[MNote], tblMsgImp.MDate = [tblMsgImp_1].[MDate]

    WHERE (((tblMsgImp.BID)=1300102) AND ((tblMsgImp_1.BID)=1300101))

    Thanks

  • You need to move the joins down...

    UPDATE tblMsgIMP

    SET ... (that whole string)

    FROM tblMsgImp INNER JOIN tblMsgImp AS tblMsgImp_1 ON tblMsgImp.MID = tblMsgImp_1.MID

    WHERE ... (where clause)

    That should work.

  • Many Thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply