SELECT
	pst.Nama,
	e.*
FROM
	dbo.Enrollment AS e INNER JOIN
	dbo.Peserta AS pst ON e.No_Proposal = pst.No_Proposal AND e.No_Peserta = pst.No_Peserta
WHERE
  e.No_Proposal = '2016.0473'
  AND e.MD_001 = '3'
ORDER BY
  e.No_Peserta

--UPDATE
--  dbo.Enrollment
--SET
--  Status = 'G'
--WHERE
--  No_Proposal = '2016.0473'
--  AND MD_001 = '3'


SELECT
	pst.Nama,
	e.*
FROM
	dbo.Enrollment AS e INNER JOIN
	dbo.Peserta AS pst ON e.No_Proposal = pst.No_Proposal AND e.No_Peserta = pst.No_Peserta
WHERE
  e.No_Proposal = '2016.0475'
  AND e.MD_001 = '3'
  AND pst.Keterangan = 'Batal daftar 2017/Resign'
ORDER BY
  e.No_Peserta

--UPDATE
--  e
--SET
--  e.Status = 'G'
--FROM
--	dbo.Enrollment AS e INNER JOIN
--	dbo.Peserta AS pst ON e.No_Proposal = pst.No_Proposal AND e.No_Peserta = pst.No_Peserta
--WHERE
--  e.No_Proposal = '2016.0475'
--  AND e.MD_001 = '3'
--  AND pst.Keterangan = 'Batal daftar 2017/Resign'

SELECT
	*
FROM
	dbo.Enrollment
WHERE
  No_Proposal = '2016.0475'
  AND Tgl_Proses = '2017-02-02'
  AND MD_001 = '3'
  AND Status = 'G'

SELECT
	*
FROM
--UPDATE
	dbo.Enrollment
--SET
--  Status = 'G'
WHERE
  No_Proposal = '2016.0471'
  --AND MD_001 = '3'
  AND Status = 'G'