Wrox Programmer Forums
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 3rd, 2009, 07:01 AM
Registered User
 
Join Date: Jul 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Left Join Problem

I have two tables (say table1 and table2).

I want to left join both tables on one column (say col1 in both tables) which has varchar datatype

in table1 column(col1) has nuemeric and varchar value also
in table2 column (col1) has only numeric value

in join query i am getting error
'Conversion failed when converting the varchar value 'CHE' to data type int'

in above 'CHE' IS VALUE IN COL1 IN TABLE1
 
Old July 3rd, 2009, 07:57 AM
Authorized User
 
Join Date: Jun 2003
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can not join a varchar column with a numeric column, How ever, it should work if you convert the numeric-column to varchar in the join.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Got problem when combine 2 tables using left join wkm1925 MySQL 1 March 27th, 2007 04:02 PM
left outer join keyvanjan Classic ASP Basics 1 April 15th, 2006 05:37 AM
left outer join keyvanjan Classic ASP Professional 0 February 5th, 2006 11:54 AM
left join msrnivas Classic ASP Databases 2 October 15th, 2004 07:37 AM
Oracle 8i inner join and left join problem puteri_84 Oracle 2 August 19th, 2004 07:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.