?
Solved

Problem in cast in sql

Posted on 2014-10-01
1
Medium Priority
?
190 Views
Last Modified: 2014-10-01
Query : select firstname, case when ProjectName Is Null Then 0 else ProjectName  end  from EmployeeTable
Left join
Projectdeatil on EmployeeTable.Employeeid = Projectdeatil.EmployeeDetailID order by firstname

Error:   Conversion failed when converting the varchar value 'Task Track' to data type int.
0
Comment
Question by:satmisha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 1500 total points
ID: 40354860
Change it to:

select firstname, case when ProjectName Is Null Then '0' else ProjectName  end  from EmployeeTable 
 Left join 
 Projectdeatil on EmployeeTable.Employeeid = Projectdeatil.EmployeeDetailID order by firstname 

Open in new window

0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question