Title: Date Range filter
Last modified: August 21, 2016

---

# Date Range filter

 *  [ckw123](https://wordpress.org/support/users/ckw123/)
 * (@ckw123)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/date-range-filter/)
 * Hello TC,
    Thanks for designing such great plugin for all WP users. I would like
   to seek for your advice. I added custom field (effective start date and effective
   end date of tickets). How can I set a filter search on date range? For example,
   user search tickets which are still effective, i.e. effective start date </= 
   today </= effective end date. Sorry I am not good at coding. Please advise. Thanks
   in advance.
 * [http://wordpress.org/plugins/ultimate-wp-query-search-filter/](http://wordpress.org/plugins/ultimate-wp-query-search-filter/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * (@wp_dummy)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/date-range-filter/#post-4534946)
 * It’s a bit tricky to query date.
    The easiest way is store your date value in
   number format by using php strtotime() when saving your date,then you can directly
   using ‘>’ or ‘<‘ for the filter field. But remember, the options of the field
   you got to manually change the value back to date format by using php date() 
   function.
 *  Thread Starter [ckw123](https://wordpress.org/support/users/ckw123/)
 * (@ckw123)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/date-range-filter/#post-4535076)
 * Thanks very much, TC. I will try to figure out though I am a basic user.
 *  [kkriss](https://wordpress.org/support/users/kkriss/)
 * (@kkriss)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/date-range-filter/#post-4535213)
 * Hello. Your plugin seems to be perfect for me, but I need also to filter all 
   custom post types between a startdate and an enddate (daterange). I read the 
   solution you gave to ckw123 but I don’t understand why using the ‘ or ‘ for filtering.
   The filter should be ‘from’ a date –> ‘to’ another date. Could you kindly explain
   me more? Thank you.
 *  Plugin Author [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * (@wp_dummy)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/date-range-filter/#post-4535215)
 * The `>` or `<` can be used for From or Before.
 * For from –> to, you can use Between instead.
 *  [kkriss](https://wordpress.org/support/users/kkriss/)
 * (@kkriss)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/date-range-filter/#post-4535216)
 * Cool, thanks! Where could I find a list of choices (from, before, or, between…
   others)?
 *  Plugin Author [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * (@wp_dummy)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/date-range-filter/#post-4535217)
 * It is on the meta field section where you choose the **Compare** select field

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Date Range filter’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/ultimate-wp-query-search-filter_fcfcfc.
   svg)
 * [Ultimate WP Query Search Filter](https://wordpress.org/plugins/ultimate-wp-query-search-filter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-wp-query-search-filter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-wp-query-search-filter/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-wp-query-search-filter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-wp-query-search-filter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-wp-query-search-filter/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [TC.K](https://wordpress.org/support/users/wp_dummy/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/date-range-filter/#post-4535217)
 * Status: not resolved