SELECT
	*
FROM
	claim_from_admedika_header
WHERE 
  dbo.func_FixedDate(create_date) = '2015-11-18'
  AND CLAIM_TYPE = 'R'
ORDER BY
  MEMBER_NAME

--DELETE FROM
--	claim_from_admedika_header
--WHERE 
--  dbo.func_FixedDate(create_date) = '2015-11-18'
--  AND CLAIM_TYPE = 'R'

SELECT
	*
FROM
	dbo.Klaim_Detail
WHERE
  No_Klaim IN (
  SELECT
	  No_Klaim
  FROM
	  dbo.Klaim_Peserta
  WHERE
    dbo.func_FixedDate(Create_Date) = '2015-11-18'
    AND Status = 'G'
    AND No_Proposal = '2015.0335'
    AND Jenis_Pembayaran = 'R'
  )

--DELETE FROM
--	dbo.Klaim_Detail
--WHERE
--  No_Klaim IN (
--              SELECT
--	              No_Klaim
--              FROM
--	              dbo.Klaim_Peserta
--              WHERE
--                dbo.func_FixedDate(Create_Date) = '2015-11-18'
--                AND Status = 'G'
--                AND No_Proposal = '2015.0335'
--                AND Jenis_Pembayaran = 'R'
--              )
--------------------------------------------------------
SELECT
	*
FROM
	dbo.Klaim_Peserta
WHERE
  dbo.func_FixedDate(Create_Date) = '2015-11-18'
  AND Status = 'G'
  AND No_Proposal = '2015.0335'
  AND Jenis_Pembayaran = 'R'

--DELETE FROM
--	dbo.Klaim_Peserta
--WHERE
--  dbo.func_FixedDate(Create_Date) = '2015-11-18'
--  AND Status = 'G'
--  AND No_Proposal = '2015.0335'
--  AND Jenis_Pembayaran = 'R'