Results 1 to 6 of 6
  1. #1
    BrockWade is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    63

    UPDATE query not working

    Can anyone see a problem in this query where I'm trying to update a field called tmpBankDebits.Matched to "Y" IF there is a match between
    tmpBankDebits.ConcatenateBankDebits AND tmpChangeOrdersWithManual.ConcatenateBank?



    UPDATE tmpBankDebits INNER JOIN tmpChangeOrdersWithManual
    ON tmpBankDebits.ConcatenateBankDebits =
    tmpChangeOrdersWithManual.ConcatenateBank SET tmpBankDebits.Matched = "Y";

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is the field a Yes/No or text data type? If Yes/No, don't put the value with quote marks and use Yes or True or -1.

    Why do you even need to save this? Saving calculated data is not usually recommended. Whether or not there is a match can be calculated when needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    BrockWade is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    63
    tmpBankDebits.Matched is a text field, so I changed it to Yes with no quotes. Still did not work.

    Long story but I can find no other way around tagging these records for further processing than the proposed query.

    The end result needs to be that of roughly 850 records in tmpBankDebits, 160 need to be tagged Yes if tmpBankDebits.ConcatenateBankDebits =
    tmpChangeOrdersWithManual.ConcatenateBank... currrently it is tagging (returning) over 1,000 records.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Any UPDATE query that can successfully edit the field can just as easily be a simple SELECT query. The same filter criteria has to work for both.

    Calculate a field in the query and apply filter criteria to that field.

    IsMatch: IIf(tmpBankDebits.ConcatenateBankDebits = tmpChangeOrdersWithManual.ConcatenateBank, "Yes", "No")

    Why the query tags more records is another issue. I don't understand the data relationships to address that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    BrockWade is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Dec 2013
    Posts
    63
    This doesn't seem to work due to syntax:

    UPDATE tmpBankDebits.Matched
    Matched: IIf(tmpBankDebits.ConcatenateBankDebits = tmpChangeOrdersWithManual.ConcatenateBank, "Yes", "No");

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    No, that won't. I was offering a suggestion to construct a field in a SELECT query, not an UPDATE, then apply filter criteria to that constructed field, not edit the field. Cannot do an edit on a calculated field.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 17
    Last Post: 12-23-2013, 11:22 AM
  2. Update Query Not Working Properly !
    By hamxa7 in forum Queries
    Replies: 3
    Last Post: 09-20-2012, 04:58 PM
  3. Update query only working on some records
    By JackieEVSC in forum Queries
    Replies: 3
    Last Post: 11-21-2011, 10:31 AM
  4. Update Inner Joing Query not working??
    By snowmman99 in forum Access
    Replies: 2
    Last Post: 09-08-2010, 12:15 PM
  5. IIf Update Query working OK but a better way?
    By dreamweaver547 in forum Queries
    Replies: 7
    Last Post: 04-19-2010, 09:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums