Hi Mallesh
this should be what you're looking for:
WHERE x BETWEEN
CASE
WHEN EXTRACT(DAY FROM CURRENT_DATE) >= 7 THEN CURRENT_DATE - 7
ELSE
ADD_MONTHS(CURRENT_DATE - (EXTRACT(DAY FROM CURRENT_DATE)-1), -1)
END
AND CURRENT_DATE
Dieter
↧