Skip to main content
Question

I want to create a filter in PQL that gives me only the POS >90 by the end of the current month.

  • November 29, 2023
  • 1 reply
  • 6 views

SELECT TO_DATE(

    TO_CHAR(ADD_MONTHS(CURRENT_DATE, 1), 'YYYY') || '-' ||

    LPAD(TO_CHAR(EXTRACT(MONTH FROM ADD_MONTHS(CURRENT_DATE, 1)), 'FM00'), 2, '0') || '-' ||

    '01',

    'YYYY-MM-DD'

) AS FIRST_DAY,

DATE '2023-12-01' - INTERVAL '1 DAY' AS END_OF_THE_MONTH

FROM "CRM_VBAK";

1 reply

  • Author
  • Level 7
  • November 30, 2023

Any ideas?