?
Solved

SQL Null values

Posted on 2011-03-23
6
Medium Priority
?
203 Views
Last Modified: 2012-05-11
when i try the following query it does not work.
CASE WHEN Resource.EmployedBy = NULL THEN 'UNKNOWN' ELSE Resource.EmployedBy END AS EmployedBy,

or

CASE WHEN Resource.EmployedBy  ISNULL THEN 'UNKNOWN' ELSE Resource.EmployedBy END AS EmployedBy,
0
Comment
Question by:aneilg
[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
6 Comments
 
LVL 18

Accepted Solution

by:
Cluskitt earned 256 total points
ID: 35197677
CASE WHEN Resource.EmployedBy  IS NULL THEN 'UNKNOWN' ELSE Resource.EmployedBy END AS EmployedBy,


You have to separate IS and NULL
0
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 248 total points
ID: 35197711
IS NULL  should do
0
 
LVL 24

Assisted Solution

by:jimyX
jimyX earned 248 total points
ID: 35197724
You can use IsNull:
ISNULL(Resource.EmployedBy, 'UNKNOWN')
0
 
LVL 41

Assisted Solution

by:Sharath
Sharath earned 248 total points
ID: 35199709
ISNULL or COALESCE would be sufficient here.

COALESCE(Resource.EmployedBy, 'UNKNOWN')
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 36032415
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

741 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