What do you mean that users want to use calendar month but extracting month from date is not ideal?
so they want to select e.g. April but not a date range (from and to) but also not “writing” April either?
Using to_char(date, ‘Month’) would have been first thought but not sure why that is not ideal.
Hi,
You can probably achieve this by matching the input parameter (lets say “MM”) against your data source and putting in a internal filter in the source query to look up only the data from this year. This is assuming that your issue stems from the fact that if you only use the Month, the query will return data for the same month for all years.
Simple example is as below
select col1, col3,etc…
from <your_view>
where to_char(<your_date_column>,'MM') = ‘$MM’ -- this is your input parameter
and to_char(<your_date_column>,'YYYY')= EXTRACT(YEAR FROM sysdate) -- to get only the curr year
Cheers.
Thanks Sajith!
Think this is the best answer / solution ! :)
Thanks!
Kasia