SHARE
TWEET

Untitled

a guest Feb 17th, 2020 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT convert(varchar, cs.CustomerUpdatedTs, 6) AS Date,
  2. card.Name_ID AS First_name,
  3.  
  4.  
  5. card.No_ID AS ID_NUMBHER,
  6. card.Additional_DOB             AS DOB,
  7. card.Home_Ph         AS Home_PHONE,
  8. card.Mobile_Ph       AS Mobile_Phone,
  9. kr.kode_kurir        AS Cheker_Name,
  10. card.CC_HSBC_Level   AS Card_type,
  11. convert(varchar,pod.pod_date, 6)        AS Tanggal_pod,
  12. card.Email           AS Email_Addres,
  13. card.Additional_Name_ID AS ADDIONAL,
  14. convert(varchar,pod.pod_code, 6)          AS GHI_CODE,
  15. cs.SF_ID             AS Sales_Force_ID,
  16. 0 AS STATUS,
  17. IIF(card.Additional_Name_ID IS NULL, 0, 1) AS STATUS_2
  18.  
  19.  
  20. FROM t_gn_customer cs
  21. LEFT JOIN t_gn_pod pod ON cs.CustomerId=pod.customer_id
  22. LEFT JOIN t_gn_app_card card ON card.Customer_ID=cs.CustomerId
  23. LEFT JOIN t_lk_kurir kr ON kr.id_kurir=pod.name_kurir
  24. WHERE cs.StatusCourier = 'Send to CCR'
  25. AND cs.out_region=0
  26.  
  27. UNION
  28.  
  29. SELECT convert(varchar, cs.CustomerUpdatedTs, 6) AS Date,
  30. card.Additional_Name_ID AS First_name,
  31.  
  32.  
  33.  
  34.  
  35.  card.Additional_No_ID AS ID_NUMBHER,
  36. card.Additional_DOB             AS DOB,
  37. '-' AS          Home_PHONE,
  38. card.Additional_Mobile_Ph       AS Mobile_Phone,
  39. kr.kode_kurir        AS Cheker_Name,
  40. card.CC_HSBC_Level   AS Card_type,
  41.  convert(varchar,pod.pod_date, 6)         AS Tanggal_pod,
  42. card.Email           AS Email_Addres,
  43. card.Additional_Name_ID AS ADDIONAL,
  44. convert(varchar,pod.pod_code, 6)          AS GHI_CODE,
  45. cs.SF_ID             AS Sales_Force_ID,
  46. 1 AS STATUS,
  47. IIF(card.Additional_Name_ID IS NULL, 0, 1) AS STATUS_2
  48.  
  49.  
  50. FROM t_gn_customer cs
  51. LEFT JOIN t_gn_pod pod ON cs.CustomerId=pod.customer_id
  52. LEFT JOIN t_gn_app_card card ON card.Customer_ID=cs.CustomerId
  53. LEFT JOIN t_lk_kurir kr ON kr.id_kurir=pod.name_kurir
  54. WHERE cs.StatusCourier = 'Send to CCR' AND card.Additional_Name_ID != '' AND card.Additional_No_ID !=''
  55. AND cs.out_region=0
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top