May 24, 2012 at 10:58 am
I have two columns same db, different tables, one is varchar( S 12345) and the other is int (12345).
I want to join the tables using these columns I don't need to used the (S)
Is there a way to do this if so how can it be done.
Joining the tables I get an error Syntax error converting the varchar value 's 12345' to a column of data type int.
Thanks
May 24, 2012 at 11:07 am
You should convert these to the same data type to join them. Ideally they would be, and you will lose some indexing benefits if they are not.
You could use a SUBSTRING command to strip out the number from the varchar field, and then a CAST to convert it to an INT.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy