Greg Larsen
SSC-Insane
Points: 20961
More actions
November 6, 2002 at 11:03 am
#440515
Yes.
Here is an example:
use pubs
go
select case when city = 'Oakland' or city = 'Menlo Park'
then 'Change City'
else city
end
from authors
Gregory Larsen, DBA
If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples
Gregory A. Larsen, MVP
Antares686
SSC Guru
Points: 125444
November 6, 2002 at 11:07 am
#440516
Perfectly legitimate.
Here is another example
SELECT CASE WHEN CONVERT(CHAR,GETDATE(),101) = '11/06/2002' OR DATEPART(dw,GETDATE()) = 3 THEN 'YES' ELSE 'NOPE' END
deek
SSCommitted
Points: 1886
November 6, 2002 at 11:08 am
#440518
yes! that's it. thank you
Viewing 3 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply