Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2002
    Location
    Sydney, Australia
    Posts
    10

    Unanswered: Eliminating spaces in query output

    Is there a way that I can do a select statement that will just select the text within a field. ie. If the field is 200 wide, but the actual text is only 20 characters, can I select JUST the 20 characters with nothing else? I need to do this for a huge number of rows .....

    Also, I'm running the select statement via osql if that helps.

  2. #2
    Join Date
    Sep 2002
    Location
    London, UK
    Posts
    3

    Thumbs up

    When selecting the column name you can use the trim function, e.g.

    select rtrim(ltrim(emp_name))
    from employees

    This will trim blank spaces from the left and right hand ends of the character string. If you only need to clear trailing blanks just use the rtrim function.

  3. #3
    Join Date
    Sep 2002
    Location
    Sydney, Australia
    Posts
    10

    Smile Thanks

    RTRIM was just what I needed, thank 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
  •