Solved

Problem in cast in sql

Posted on 2014-10-01
1
187 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
1 Comment
 
LVL 24

Accepted Solution

by:
Phillip Burton earned 500 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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