Results 1 to 12 of 12
  1. #1
    Abazaba is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    7

    I don't want to update with text.

    Is there a syntax that I can use in my update query that will exclude any text from being updated? I have a field with numbers and text, and I want to update another field with only the numbers. Currently it updates the field with records that contained text to 0s. I want those records to stay blank.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    How about

    UPDATE...
    SET...
    WHERE IsNumeric(FieldName)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Abazaba is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    7
    That worked! Thank you so much. I'm new to this.

  4. #4
    Abazaba is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    7
    Maybe I spoke too soon.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Let me know; I would think that would only update records where the specified field had a numeric value, but I didn't test.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Abazaba is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    7
    I'm a complete noob. It worked, and now it doesn't seem to want to work again. This is my SQL if it helps:

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    I don't see anything wrong with that offhand, though I wouldn't bother with the "<>False" part. What do you mean that it won't work again? After it's run once, there shouldn't be anything left to change anyway.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Abazaba is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    7
    It literally did what I wanted, then I tried it again on the same unchanged table and now it proposes no changes.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Can you post the db, or a sample that exhibits this behavior?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    Abazaba is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    7
    I got it working, thanks for the help!

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    No problem, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    Abazaba is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    7
    Thanks! I'm sure I'll be back with many more questions. This place looks like a great source of information.

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

Similar Threads

  1. Replies: 15
    Last Post: 04-01-2011, 11:41 AM
  2. Replies: 1
    Last Post: 01-22-2011, 12:23 PM
  3. Update a text box based on a combo box
    By fleschnj in forum Access
    Replies: 1
    Last Post: 11-08-2010, 12:14 PM
  4. Replies: 1
    Last Post: 11-05-2010, 04:31 PM
  5. Replies: 2
    Last Post: 05-05-2010, 02:52 PM

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