Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT
- (CASE WHEN idh.idh_slspsn##1 IS NULL OR idh.idh_slspsn##1 = '' THEN 'NO DISTRIBUTOR' ELSE idh.idh_slspsn##1 END) AS Distributor,
- (CASE WHEN idh.idh_slspsn##2 IS NULL OR idh.idh_slspsn##2 = '' THEN 'NO REP' ELSE idh.idh_slspsn##2 END) AS Rep,
- LEFT(idh.idh_slspsn##2,len(idh_slspsn##2 - 3)) AS Repshort
- FROM FinanceDev.dbo.idh_hist idh
- WHERE idh.idh_acct <> '21700' AND idh.idh_acct <> '42060'
- ORDER BY Distributor, Rep ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement