Solved

Problem in cast in sql

Posted on 2014-10-01
1
176 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now