Ad-hoc Query: Transfer Protocols -------------------------------- Old Version =========== SELECT q.doc_id AS "CDR ID", q.value AS 'Date Of Transfer', d.value 'PRIMARY ID' FROM query_term q JOIN query_term d ON q.doc_id = d.doc_id AND d.path = '/InScopeProtocol/ProtocolIDs/PrimaryID/IDString' WHERE q.path = '/InScopeProtocol/CTGovOwnershipTransferInfo/CTGovOwnershipTransferDate' ORDER BY q.value desc New Version =========== SELECT q.doc_id AS "CDR ID", q.value AS 'Date Of Transfer', d.value 'PRIMARY ID' FROM query_term q JOIN query_term d ON q.doc_id = d.doc_id AND (d.path = '/CTGovProtocol/IDInfo/OrgStudyID' OR d.path = '/InScopeProtocol/ProtocolIDs' + '/PrimaryID/IDString' ) WHERE (q.path = '/CTGovProtocol/PDQAdminInfo' + '/CTGovOwnershipTransferInfo' + '/CTGovOwnershipTransferDate' OR q.path = '/InScopeProtocol' + '/CTGovOwnershipTransferInfo' + '/CTGovOwnershipTransferDate' ) ORDER BY q.value desc