Tuesday, 15 March 2011

Combine two Columns into one in a Microsoft SQL Statement

First post of the day, and just a quickie here for a Microsoft SQL Statement. This one is basically for use, if say, you have two fields for example one is first name and the other is last name. This short command in the 'SELECT' section of the SQL statement will condense two fields/columns into one.

(RTRIM(forname) + ' ' + RTRIM(lastname)) AS fullname
There go, short and simple! :)

No comments:

Post a Comment