Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Case Statement

Posted on 2011-03-25
1
Medium Priority
?
217 Views
Last Modified: 2012-05-11
use Nas 
Select	datename(mm,Application_Date) as ApplicationMonth,
		year(Application_Date) as ApplicationYear,
		A.Application_ID,
		--Case When ApplicationApplicant.Applicant_ID  'is null' then 'Indv' else 'joint' end as 'AppInd'
		
		
		ApplicationApplicant.Applicant_ID
		--ApplicantCompany.Applicant_ID
		
		
from	dbo.Application A
		left join ApplicationApplicant on ApplicationApplicant.Application_ID = A.Application_ID
		left join ApplicantCompany on ApplicantCompany.Application_ID = A.Application_ID
		left join Applicant on Applicant.Applicant_ID = ApplicationApplicant.Applicant_ID
		left join Applicant Ap on Ap.Applicant_ID = ApplicantCompany.Applicant_ID
where	Application_Date Between '2010-12-01 00:00:00' and '2010-12-31 23:59:59'
 order by 3

Open in new window


Hi I am trying to point a case statement in that creates a new column that will show the name 'jnt'
in the 'ApplicationApplicant.Applicant_ID' column shows Null  and show 'Ind' if i has a number in the 'ApplicationApplicant.Applicant_ID'  column
Test-Data-Jnt-Bond.xls
0
Comment
Question by:Davesm
[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 5

Accepted Solution

by:
soujanya_g earned 2000 total points
ID: 35214086
Hi

You are checking Is Null in single quotes as 'is null' but you have to check as   "ApplicationApplicant.Applicant_ID  Is Null"




 
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

597 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