Combining 2 CHAR() fields to display without padded spaces...

  • I have 2 fields as CHAR(15) and CHAR(21) which represent an employee's first name and last name respectively (this is a Microsoft Dynamics Great Plains Database). I am trying to combine the two in a query so that I can export just a single column with the employee's full name.

    SELECT FRSTNAME + ' ' + LASTNAME

    FROM UPR00100

    I realized that these fields must have been CHAR() when I viewed the result.

    JON DOE

    JOHN JOHNSON

    BETHANY JOHNSON

    ...

    Is there any way to change this such that there is only 1 space between the first and last name without altering the actual datatypes in the table?

    Jared

    Jared
    CE - Microsoft

  • Use the RTRIM function on the FIRSTNAME. LIke this

    Select RTRIM(FirstName) + ' ' + LastName

  • Perfect! Thanks much!

    Jared
    CE - Microsoft

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply