Operation Details
Description: This method checks for overlapping periods with other records of the same milestone type.
Sterotype: ns
SQL
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 
    ) 
  )