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.
| Author |
Topic |
|
jimdarter
Starting Member
14 Posts |
Posted - 2012-05-15 : 11:48:18
|
| Hi- I need to join two tables having the following common field. Is there a way to join them on this field 'ID' since in table 1 ID field has no zeros in front but in table 2 there are zeros infront until the number reaches 4 digits (zeros are only until 999).Table-1 ID367910129811123277799910011112Table-2ID00030006000700090010001200980111023207770999 |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2012-05-15 : 11:54:21
|
| SQL might do the conversion implicitly for you, but just to be sureFROM table1JOIN table2 ON table1.Id = convert(int,table2.ID)JimEveryday I learn something that somebody else already knew |
 |
|
|
|
|
|