?
Solved

Case Statement

Posted on 2011-03-25
1
Medium Priority
?
216 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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

762 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