Title: Using Custom Field Filter subquery for testing date interval
Last modified: May 19, 2023

---

# Using Custom Field Filter subquery for testing date interval

 *  [xarz](https://wordpress.org/support/users/xarz/)
 * (@xarz)
 * [3 years ago](https://wordpress.org/support/topic/using-custom-field-filter-subquery-for-testing-date-interval/)
 * What I want to achieve:
   Show upcoming/pasts events (custom type created with 
   ACF) using Custom Post type block
 * I have a custom post type for events. In there I’ve custom fields for the event
   like date (not the post date, the event date).
 * I want to show only upcoming events, and discrimine past events. In the custom
   post type block we have a custom field filter and in theory I might be able to
   filter the past events but I don’t know if this field could manage something 
   like:
   Show events that his date is bigger than todayevent_date > today()+ datetime(
   type)
 * but this is not working. I supose that the filter don’t have the ability to test
   the funcion “today()” isn’t it?
 * How I must use this filter to only show upcoming events and viceverse without
   editing a state field or something like that.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fusing-custom-field-filter-subquery-for-testing-date-interval%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘Using Custom Field Filter subquery for testing date interval’ is closed
to new replies.

 * ![](https://ps.w.org/getwid/assets/icon.svg?rev=2238400)
 * [Getwid - Gutenberg Blocks](https://wordpress.org/plugins/getwid/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/getwid/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/getwid/)
 * [Active Topics](https://wordpress.org/support/plugin/getwid/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/getwid/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/getwid/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * 0 replies
 * 1 participant
 * Last reply from: [xarz](https://wordpress.org/support/users/xarz/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/using-custom-field-filter-subquery-for-testing-date-interval/)
 * Status: not resolved