siva raman

siva raman

  • NA
  • 173
  • 3k

How to display previous month data if current month have

Mar 24 2017 6:08 AM

I have created a view in Drupal 7. On pager i have used page by date, also checked on Skip empty pages and its working fine. But there is one problem on my view suppose there is no records for April but record exist for February or March and I have given default filter "Provide default value: Current Date" so by default it is displaying current month data.

Current month have no records into database so it is displaying empty page. I want it to display last month records if last month doesn't have record then it should skip empty page and display last last month record.

I have checked skip empty page on views settings so it is working fine and whenever it get empty page it skipped the page and displays next or previous month record.

Is it possible to display last ot last last month record if current month have no results.


Answers (1)