Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 concatenate 2 values

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2005-02-20 : 16:05:31
I am trying to do the following query

select mydate,filesource+''+myid as mynewid,FirstName,LastName,email,address from users

filesource and myid are both integers. I want them to be returned combined so if filesource is 2 and myid is 5 mynewid would be 25 --
the above query is not working. What am I doing wrong?

Andraax
Aged Yak Warrior

790 Posts

Posted - 2005-02-20 : 16:27:03
you need to cast or convert the integers to varchars. look up cast or convert in BOL for syntax help.

/Andraax
Go to Top of Page
   

- Advertisement -