Microsoft
Software
Hardware
Network
Question : Need help with CASE statement
I have read CASE syntax, but I am still confuse. I want to write a CASE base on targetID as follow:
targetID = 1
FabricToSend="1 yard"
targetID = 2
FabricToSend = "2 yard"
i have no clue on how to start. :(
can someone guide me?
thanks
Answer : Need help with CASE statement
SELECT FabricToSend = CASE (TargetID) when 1 then '1 yard' when 2 then '2 Yard' else null end
or
SELECT FabricToSend = = CAST (TargetID as varchar)+ ' yard'
Random Solutions
active directory, W2k8 R2 DC, Kerberos failures, Event ID: 3, 4771, 4769, 4768, 4776, 4625 source: Microsoft Windows security
Problem with "like" keyword, when database is in chinese
VS2008 opens .aspx files in new IE window instead of Designer/Source Editor
Pass Web Page as Parameter to Class in App_Code Folder
Opening Organization chart with open office
SQL Count Query In a Main Query
Outlook 2007 connecting to Exchange 2010. Cannot connect to email folders.
Compaq Presario SR5010NX Desktop PC
How do you check the current date format of an SQL Server 2005 database?
Exchange 2010 coexistence with Exchange 2003