Glowworm27
Programmer
Hello all,
I am joining some tables together to produce a report.
In one of the joins I am doing a left join and occasionaly that will not return data to my select query.
I am trying to create a select case query that when the left join does not join a record to use the data in another field but I cant get it to work
George Oakes
CEO & President
COPS Software, Inc.
Programmer & Developer
.Net, WSS 3.0, SQL DBA
Check out this awsome .Net Resource!
I am joining some tables together to produce a report.
In one of the joins I am doing a left join and occasionaly that will not return data to my select query.
I am trying to create a select case query that when the left join does not join a record to use the data in another field but I cant get it to work
Code:
select
Case rtrim(nm.last) WHEN NULL
Then (rtrim(cd.partylastname) || ', ' || rtrim(cd.PartyFirstName))
ELSE (rtrim(nm.last) || ', ' || rtrim(nm.First) || ' ' || rtrim(nm.middle)) END as personName
From temp_co_data cd
left join nmmain nm on cd.Name_ID = nm.Name_ID
George Oakes
CEO & President
COPS Software, Inc.
Programmer & Developer
.Net, WSS 3.0, SQL DBA
Check out this awsome .Net Resource!