Click here to Skip to main content
15,913,467 members
Home / Discussions / Database
   

Database

 
AnswerRe: SQL Sample Databases Pin
gharry6-Jan-06 5:44
gharry6-Jan-06 5:44 
QuestionSQL Doubt. Pin
<color>Aljechin 5-Jan-06 19:32
<color>Aljechin 5-Jan-06 19:32 
AnswerRe: SQL Doubt. Pin
nguyenvhn5-Jan-06 20:48
nguyenvhn5-Jan-06 20:48 
AnswerRe: SQL Doubt. Pin
Colin Angus Mackay5-Jan-06 20:49
Colin Angus Mackay5-Jan-06 20:49 
QuestionDAO Notification? Pin
lynchspawn5-Jan-06 9:51
lynchspawn5-Jan-06 9:51 
AnswerRe: DAO Notification? Pin
Dave Kreskowiak6-Jan-06 5:05
mveDave Kreskowiak6-Jan-06 5:05 
QuestionPartial name Pin
gharry5-Jan-06 9:47
gharry5-Jan-06 9:47 
AnswerRe: Partial name Pin
Colin Angus Mackay5-Jan-06 11:01
Colin Angus Mackay5-Jan-06 11:01 
GeneralRe: Partial name Pin
gharry5-Jan-06 22:46
gharry5-Jan-06 22:46 
GeneralRe: Partial name Pin
Colin Angus Mackay6-Jan-06 1:45
Colin Angus Mackay6-Jan-06 1:45 
QuestionReading CSV file into DataGrid Pin
gharry5-Jan-06 5:32
gharry5-Jan-06 5:32 
QuestionProblem populating table Pin
TheJudeDude5-Jan-06 5:06
TheJudeDude5-Jan-06 5:06 
AnswerRe: Problem populating table Pin
Colin Angus Mackay5-Jan-06 6:45
Colin Angus Mackay5-Jan-06 6:45 
GeneralRe: Problem populating table Pin
TheJudeDude5-Jan-06 14:38
TheJudeDude5-Jan-06 14:38 
GeneralRe: Problem populating table Pin
Colin Angus Mackay5-Jan-06 20:45
Colin Angus Mackay5-Jan-06 20:45 
GeneralRe: Problem populating table Pin
TheJudeDude7-Jan-06 3:30
TheJudeDude7-Jan-06 3:30 
GeneralRe: Problem populating table Pin
Colin Angus Mackay7-Jan-06 3:42
Colin Angus Mackay7-Jan-06 3:42 
QuestionSQL query Pin
Deian5-Jan-06 4:33
Deian5-Jan-06 4:33 
AnswerRe: SQL query Pin
Colin Angus Mackay5-Jan-06 6:39
Colin Angus Mackay5-Jan-06 6:39 
GeneralRe: SQL query Pin
Deian5-Jan-06 7:32
Deian5-Jan-06 7:32 
QuestionRe: SQL query Pin
Deian6-Jan-06 5:22
Deian6-Jan-06 5:22 
QuestionJoin On Null?? Pin
tadhg885-Jan-06 3:05
tadhg885-Jan-06 3:05 
Hi i am havin a bit of trouble with the joins in this query as some of the values stored in the main table may be entered into the table as nulls so
when i try to join the another table using these values it will not work an i dont get back any rows does anyone have any ideas how to solve this problem

Thanks in advance Tim



select IsNull(p.firstName+ ' ','') + IsNull(p.MiddleName+ ' ','') + IsNull(p.LastName,'') as Name, i.Diagnosis as Injury,
SUBSTRING(CAST(i.Date as nvarchar), 0 ,12) as Date, im2.Name as Prognosis, imgoi.Name as GradOfInjury, impob.Name as PartOfBody,
imtt.Name as TissueType, imact.Name as Activity, imsur.Name as Surface, imsurcon.Name as SurfaceCondidtions, imfw.Name as Footwear,
'Recovered' = CASE WHEN i.Date IS NOT NULL and (i.DateRecovered IS NULL)
THEN 'No' ELSE 'Yes' END from injury i

join Person p on p.Id = i.PersonID
join InjuryMapping im2 on im2.ID = i.Prognosis
join InjuryMapping imgoi on imgoi.ID = i.GradeOfInjury
join InjuryMapping impob on impob.ID = i.PartOfBody
join InjuryMapping imtt on imtt.ID = i.TissueType
join InjuryMapping imact on imact.ID = i.Activity
join InjuryMapping imsur on imsur.ID = i.Surface
join InjuryMapping imsurcon on imsurcon.ID = i.SurfaceConditions
join InjuryMapping imfw on imfw.ID = i.Footwear

where (p.ID = 3 and i.ID = 87) or (p.ID = 7 and i.ID = 82)
order by p.Lastname

AnswerRe: Join On Null?? Pin
Colin Angus Mackay5-Jan-06 3:28
Colin Angus Mackay5-Jan-06 3:28 
GeneralRe: Join On Null?? Pin
tadhg885-Jan-06 4:42
tadhg885-Jan-06 4:42 
QuestionMSDE 2000 upgrade to SQL Server 2005 Developer Pin
Kevin McFarlane5-Jan-06 2:34
Kevin McFarlane5-Jan-06 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.