Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    29

    Unanswered: Adding text strings

    how can you trim the spaces to produce the correct output

    declare @first_name char(25)
    declare @last_name char(25)
    declare @free_text char(200)

    select @first_name = 'Jim'
    select @last_name = 'Richards'

    select @free_text = @first_name
    select @free_text = @free_text + @last_name

    select @free_text, employee_id
    from employee

    ....this produces....Jim Richards as the @free_text
    but I want
    .....Jim Richards

  2. #2
    Join Date
    Aug 2004
    Posts
    42
    select @free_text = rtrim (@free_text) + ' ' + @last_name

Posting Permissions

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