Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

MSG 156

$
0
0
Group by SD.Sales_Order, SD.SO_Line, M.Selling_Price, C.Type, SD.Total_Price, SD.Order_Qty, CP.Sell_Price, CP20.Sell_Price, CP30.Sell_Price, CP40.Sell_Price, M.Class, 
 (Case when (PATINDEX('%RGA%',       SH.Comment)>0) then 'R'
       when (PATINDEX('%MARKETING%', SH.Comment)>0) then 'M' 
       when SD.Material = 'CUSTOM-SPECIAL'          then 'C'
       When SD.Material = 'INSTALLATION'            then 'I'
       when M.Class = 'PRVT LABEL'                  then 'P'
       else '' end) as bbb, SH.Source, SH.Ship_Via, SD.Material
I am trying to use the Case command to create a value in bbb or I could use SH.Source which is a Varchar(20) field. Any ideas on how to do this would be greatly appreciated.

SWProduction


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>