SELECT     *
FROM         welfare.WF1_TXN_MARRIAGE
where doc_no = ‘WF070810018’

SELECT     *
FROM         welfare.HR_TXN_SAP_Detail
where (doc_no = ‘WF070810018’ or batch_real_flag = ‘B’)
and convert(varchar, sent_sap_date,112) = ‘20070807’

SELECT     *
FROM         welfare.HR_TXN_SAP_Summary
where convert(varchar, sent_sap_date,112) = ‘20070807’