Archive

Posts Tagged ‘MS SQL’

Round A Number In MS SQL

November 10th, 2008 No comments

To round a number in MS SQL use the ROUND() function. This function takes two parameters, the first is the number to be rounded and the second is the number of decimal places to round the number to. Here is an example of rounding the numbers in a column to the nearest whole integer.

SELECT ROUND(table.column1,0) rentValue FROM table

Categories: MS SQL Tags: , , , , ,

Concatenate Strings In MS SQL

November 7th, 2008 No comments

If you want to concatenate the output of three different columns in MS SQL just use the + symbol.

SELECT table.column1 + ' ' + table.column2 + ' ' + table.column3 output FROM table

The resulting column will be the values of the three columns under the name of output

Categories: MS SQL Tags: , , , ,