Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Name Column while in Case When

Author  Topic 

hahsm
Starting Member

10 Posts

Posted - 2009-02-10 : 11:52:16
I have this code

Case
When LateTime Is Not Null Then LateTimeCard
Else
Null
End

This gives me a black column name when the result shows. Why is this happening and how can i get the column name. Pls note that the actual column name is LateTime

Thanks in advance

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-02-10 : 12:01:54
Case returns one value and you give it one name.

case
when x is not null then y
else z
end as YourColumnName_here

Webfred


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -