SELECT
investigationConfigID,
type,
homePageIdentifier,
startDate,
endDate,
readSecurity,
approveSecurity,
createSecurity,
maintainSecurity,
createEvent,
closeEvent,
creationDate,
recordStatus,
comments
INTO
:investigationConfigID,
:type,
:homePageIdentifier,
:startDate,
:endDate,
:readSecurity,
:approveSecurity,
:createSecurity,
:maintainSecurity,
:createEvent,
:closeEvent,
:creationDate,
:recordStatus,
:comments
FROM
InvestigationConfig
WHERE type = :type
AND recordStatus = :recordStatus
AND
(
(
startDate <= :endDate
AND endDate >= :startDate
)
OR
(
endDate is null
AND :endDate is null
)
OR
(
endDate is null
AND :endDate >= startDate
)
OR
(
:endDate is null
AND endDate >= :startDate
)
)
|