Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Location
    Houston, TX
    Posts
    34

    Unanswered: trim space from some fields

    I have a table with a keyword field. In this keyword field some of the entries have a space before the word and some don't.
    How can I remove all of the spaces from the fields that have them and not trim from the ones that don't.

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    drop table #test
    create table #test(f1 varchar(100))
    insert #test values(' ewtrert')
    insert #test values('ewtrert')
    insert #test values(' ewtrert')
    insert #test values(' ewtrert')
    insert #test values(' ewtrert')
    insert #test values('ewtrert')
    update #test set f1=LTRIM(f1) from #test
    select * from #test

Posting Permissions

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