Results 1 to 5 of 5
  1. #1
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283

    Removing last Character if it is a comma

    Hello,

    I am trying to remove the last character in the field if it is a comma. I have this code written so far but when I run it, instead of just removing the "," in the field it removes the text in the whole field. If you can help me out I would appreciate it.

    UPDATE New_Users SET New_Users.Ready_To_Sell = LEFT(Ready_To_Sell, LEN(Ready_To_Sell - 1)) WHERE Right(New_Users.Ready_To_Sell,1) = ',';

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I think it should be:

    ...LEN(Ready_To_Sell) - 1)

    Pin other words, the minus 1 outside the Len() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Spend ten minutes looking at this video and you should be able to achieve what you want.

    http://www.datapigtechnologies.com/f...anipulate.html

  4. #4
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Woot! Thank you pbaldy!

  5. #5
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 18
    Last Post: 10-11-2017, 03:07 PM
  2. removing star character
    By Ruegen in forum Queries
    Replies: 1
    Last Post: 04-23-2014, 07:09 PM
  3. Replies: 5
    Last Post: 05-15-2013, 03:18 PM
  4. comma in a query
    By jscriptor09 in forum Access
    Replies: 1
    Last Post: 05-18-2012, 04:18 PM
  5. Comma
    By tmcrouse in forum Queries
    Replies: 4
    Last Post: 10-11-2011, 04:33 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