Display the month names based on selected year.
Query-1 : Extract Year
SELECT DISTINCT
EXTRACT(YEAR FROM "DATE")::integer as year
FROM dimcalendar
Query-2 : Extract Month From selected Year ( In some cases report needs to display till current month)
select DISTINCT to_char("DATE", 'Month')::text Mon from dimcalendar
where EXTRACT(YEAR FROM "DATE")::integer = ${paramYear}
:-)
Query-1 : Extract Year
SELECT DISTINCT
EXTRACT(YEAR FROM "DATE")::integer as year
FROM dimcalendar
Query-2 : Extract Month From selected Year ( In some cases report needs to display till current month)
select DISTINCT to_char("DATE", 'Month')::text Mon from dimcalendar
where EXTRACT(YEAR FROM "DATE")::integer = ${paramYear}
No comments:
Post a Comment