Skip Navigation

[Resolved] Split: filter to show only results with future date

This thread is resolved. Here is a description of the problem and solution.

Problem:

The customer reported that adding a query filter for a date type field in a view to show only future events, is not working.

Solution:

Informed that to show only those posts, whose date type custom field value is either equal to today or in a future day, one will need to use the 'numerical' comparison with 'greater than or equal to' operator with 'TODAY'.

Screenshot available in the reply:
https://toolset.com/forums/topic/split-filter-to-show-only-results-with-future-date/#post-2222243

Relevant Documentation:

n/a

This support ticket is created 3 years, 12 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by ludovicD-3 3 years, 12 months ago.

Assisted by: Waqar.

Author
Posts
#2222189

Hello Waqar,

filter the events: if I don’t add a filter, all events are displayed, which is good… for now: when a concert has passed, I don’t want it to appear anymore. But as soon as I add a filter to show only future concert dates based on my custom field, I get a “no records found”. I’m obviously doing something wrong, but what? See attached image for the setting I use in the filter.

Thanks again and best regards,

Ludovic

#2222243
date-field-filter-example.png

Hi Ludovic,

If your goal is to show only those posts, whose date type custom field value is either equal to today or in a future day, you can use the 'numerical' comparison with 'greater than or equal to' operator with 'TODAY'.
( example screenshot attached )

Note: If you don't want to include today's results, you can use the 'greater than' operator instead.

regards,
Waqar

#2222805

Thanks for the reply... which to me doesn't make sense since the concert date is, well, a date, and when I make a comprison with TODAY, I had set concert-date as a DATE (obviously). When set as NUMBER... it works. Strange but all that matter is that it's solved. Thanks!