Advertisement
Guest User

Untitled

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