---
title: "SQL-023: Retrieve group discount as of a date"
summary: Retrieve group discount as of a date
status: draft
owner: Technical Writer
last_reviewed: 2026-07-31
library: SAIF.Business.Policy.Group
reference_type: package
---

# SQL-023: Retrieve group discount as of a date

`SQL-023` retrieve group discount as of a date in support of `clsGroupAssociationDiscount`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-023 |
| **Operation type** | Read |
| **Execution method** | Inline SQL via BOF data portal |
| **Database** | Oracle |
| **Schema** | `[unqualified]**` |
| **Command type** | Text |
| **Business object** | `clsGroupAssociationDiscount` |
| **Criteria property** | `RetrieveSQL` (+ const `Retrieve_SQL`) |
| **Lifecycle method** | `BeforeRetrieve` / `AfterRetrieve` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:GroupAssociationCode` | In | String | not specified | Criteria property — owning group code. |
| `:EffectiveDate` | In | Date | not specified | Criteria property — as-of date; bound three times to select the discount row whose period spans the date. |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [GROUP_ASSOCIATION_DETAIL](../database-tables.md#group_association_detail) | SELECT | GROUP_ASSOCIATION_CODE, EFFECTIVE_DATE, EXPIRATION_DATE, PCNT_DISCOUNT, CREATE_DATE, CREATE_USER_NAME, UPDATE_DATE, UPDATE_USER_NAME, PENDING_FLAG |

## Sample SQL

```sql
Select
  GROUP_ASSOCIATION_DETAIL.GROUP_ASSOCIATION_CODE as GroupAssociationCode,
  GROUP_ASSOCIATION_DETAIL.EFFECTIVE_DATE as EffectiveDate,
  GROUP_ASSOCIATION_DETAIL.EXPIRATION_DATE as ExpirationDate,
  GROUP_ASSOCIATION_DETAIL.PCNT_DISCOUNT as GroupDiscount,
  GROUP_ASSOCIATION_DETAIL.CREATE_DATE as CreateDate,
  GROUP_ASSOCIATION_DETAIL.CREATE_USER_NAME as CreateUser,
  GROUP_ASSOCIATION_DETAIL.UPDATE_DATE as UpdateDate,
  GROUP_ASSOCIATION_DETAIL.UPDATE_USER_NAME as UpdateUser,
  GROUP_ASSOCIATION_DETAIL.PENDING_FLAG as TentativeFlag
From
  GROUP_ASSOCIATION_DETAIL
Where
  GROUP_ASSOCIATION_DETAIL.GROUP_ASSOCIATION_CODE = :GroupAssociationCode
  AND (
    GROUP_ASSOCIATION_DETAIL.EFFECTIVE_DATE <= :EffectiveDate
    AND (
      GROUP_ASSOCIATION_DETAIL.EXPIRATION_DATE is null
      OR GROUP_ASSOCIATION_DETAIL.EXPIRATION_DATE > :EffectiveDate
    )
  )
```

## Operations and processes
- [Supply the group discount factor to rating](../operations/supply-group-discount-factor.md)

> **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.

## Sources
- `Business\SAIF.Business.Policy.Group\clsGroupAssociationDiscount.vb`
