View Full Version : Concat two int columns into one


shazaduh
07-17-2007, 04:58 PM
I got a access SQL question.

Let's say we have two int columns, I want to get the results Column1 + Column2 in string format

i.e

Column1 - Column2
5 - 2
6 - 2.5
10 - 6.5
10.5 - 8


I need to return the data as new column like:

NewColumn
"5 to 2"
"6 to 2.5"

so on

SQL + operator only works for string operation, how would I use it for numeric data type.

Thanks a bunch
shazaduh

KenHigg
07-17-2007, 05:00 PM
Something like:

str(myColOne) & " to " & str(myColTwo)

???
ken :)

edit: Those samples aren't int's are they?

shazaduh
07-18-2007, 10:44 AM
Thanks KenHigg

This works fine, I was using Cstr for some reason.