clsAssociationTypeCode uses this statement to attach a coverage date range to each associated policy shown in a policy header. Only the most recent issued period counts, where "issued" means a printed P401 endorsement or a non-WCIS period in status E.
selectpp.policy_numasPolicyNumber,pp.policy_period_eff_dateasEffectiveDate,nvl(pp.cancel_date,pp.policy_period_exp_date)asExpirationDatefrompolicy_period_allppjoin(-- get the most recent issued period per policyselectpp.policy_num,max(pp.policy_period_eff_date)aspolicy_period_eff_datefrompolicy_period_allppjoin(-- get all issued periods for all policiesselectpolicy_period_eff_date,policy_numfromendorsementwhereendorse_code='P401'andprinted_dateISNOTNULLunionselectpolicy_period_eff_date,policy_numfrompolicy_period_non_wciswherepolicy_period_status_code='E')issued_periodsonpp.policy_num=issued_periods.policy_numandpp.policy_period_eff_date=issued_periods.policy_period_eff_datewherepp.policy_period_eff_date<>nvl(cancel_date,policy_period_exp_date)groupbypp.policy_num)max_periodsonpp.policy_num=max_periods.policy_numandpp.policy_period_eff_date=max_periods.policy_period_eff_datewherepp.policy_numin({0})
Note: Statements marked with * were inferred from code structure, naming
conventions, or contextual evidence where direct confirmation was not available
in source artifacts. Statements marked with ** could not be confirmed; treat
as unknown until verified.