Documentazione Invantiveparte di invantive cloud
Forum di supporto InvantiveAccedi / Registrati

TRIMESTRE

Sintassi

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> QUARTER[QUARTER]:::quoted
    QUARTER --> End((END))

Scopo

La funzione SQL QUARTER estrae il trimestre da una data.

Vedi anche MONTH e YEAR.

Parametri:

  • Input (datetime): Un datetime.

Restituisce: il quarto, espresso come numero intero.

Esempi

L'esempio seguente recupera il trimestre di marzo 15, 2026:

select quarter(to_date('20260315', 'YYYYMMDD'))

-------------------
1

L'esempio seguente recupera il trimestre di ottobre 1, 2026:

select quarter(to_date('20261001', 'YYYYMMDD'))

-------------------
4