SELECT
	*
FROM
	dbo.KlaimFrom_Detail
WHERE
  Claim_Ref IN (
                SELECT
	                Claim_Ref
                FROM
	                dbo.KlaimFrom_Header
                WHERE
                  --Status = 'G'
                  --AND 
                  Create_Date = '2015-11-09'
               )
AND Create_Date = '2015-11-09'
--DELETE
--FROM
--	dbo.KlaimFrom_Detail
--WHERE
--  Claim_Ref IN (
--                SELECT
--	                Claim_Ref
--                FROM
--	                dbo.KlaimFrom_Header
--                WHERE
--                  Status = 'G'
--                  AND 
--                  Create_Date = '2015-11-09'
--               )
--AND Create_Date = '2015-11-09'



SELECT
	*
FROM
	dbo.KlaimFrom_Header
WHERE
  --Status = 'G'
  --AND 
  Create_Date = '2015-11-09'
--ORDER BY
--  Create_Date DESC



--DELETE
--FROM
--	dbo.KlaimFrom_Header
--WHERE
--  Status = 'G'
--  AND Create_Date = '2015-11-09'

  