Database SQL Operation: MilestoneConfiguration.countMilestoneDuplicatePeriods
Description: | This method checks for overlapping periods with other records of the same milestone type. |
Sterotype: | ns |
SELECT
COUNT(*)
INTO
:numberOfRecords
FROM
MilestoneConfiguration MC,
TextTranslation TT
WHERE TT.shortText = :name
AND recordStatus = :recordStatus
AND TT.localeCode = :localeCode
AND TT.localizableTextID = MC.nameTextID
AND
(
(
endDate IS NULL
AND
(
:startDate >= startDate
)
)
OR
(
:startDate >= startDate
AND :startDate <= endDate
)
OR
(
:endDate >= startDate
AND :endDate <= endDate
)
OR
(
:endDate IS NULL
AND :startDate <= endDate
)
)
|