Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2013
    Posts
    2

    Unanswered: Question with SQL Query

    I have the following Update query:
    Code:
    UPDATE TmpTable INNER JOIN Users ON TmpTable.GUID = Users.GUID SET Users.Size = [TmpTable].[Size]
    WHERE (((TmpTable.Size)<>[Users].[Size]));"
    This works fine where [TmpTable].[Size] = TEST123 and [Users].[Size] = TEST321
    It updates [Users].[Size] to TEST123 when GUID matches

    However, it doesn't work if there's a NULL value in EITHER table entry.
    This is really annoying. Does anyone know why this is?
    Prior I was running an update table for ALL entrys where GUID Matches, but this took too long and locked the Users (odbc linked) table.

  2. #2
    Join Date
    Jan 2005
    Posts
    146
    Have you tried using Nz()?
    Code:
    UPDATE TmpTable INNER JOIN Users ON TmpTable.GUID = Users.GUID SET Users.Size = [TmpTable].[Size]
    WHERE (((Nz(TmpTable.Size,""))<>Nz([Users].[Size],"")));"

  3. #3
    Join Date
    Jul 2013
    Posts
    2
    Quote Originally Posted by billmeye View Post
    Have you tried using Nz()?
    Code:
    UPDATE TmpTable INNER JOIN Users ON TmpTable.GUID = Users.GUID SET Users.Size = [TmpTable].[Size]
    WHERE (((Nz(TmpTable.Size,""))<>Nz([Users].[Size],"")));"


    Wow thank's for the quick reply. All sorted now!
    I've used NZ() before but didn't think in this situation, doh!

  4. #4
    Join Date
    Jan 2005
    Posts
    146
    Glad it worked for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •