i have to display the month and year from 2000 jan to till current month and year (it should be above month of the current year)
exmple: Jan 2000 to Current month and year(august 2022) in Drop down
Hello Ganeshkumar.Usually I build months table with CTE or get them from an existing table.On this case, I looked for a new approach.I used the WITH to create a list of possible months.For the years, I did similar, but generated all possible combinations of 4 digits.Then I just match year/month inside the given dates and return that list.
On the oml you can see it at work with a demo page.