Title: between not work in wp_query
Last modified: December 13, 2016

---

# between not work in wp_query

 *  [Nimesh Rathod](https://wordpress.org/support/users/nimeshrathod1gmailcom/)
 * (@nimeshrathod1gmailcom)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/between-not-work-in-wp_query/)
 * hello,
 * I have use the query like this:
 *     ```
       $args = array('post_type' => 'event', 'meta_query' => array(array(
       'key' => $current_date,
       'value' => array('_event_start_date','_event_end_date'),
       'compare' => 'BETWEEN',
       'type' => 'DATE')));
       ```
   
 * but it give me blank result where as i have record between start and end date..!!!

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

 *  [Jacob Peattie](https://wordpress.org/support/users/jakept/)
 * (@jakept)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/between-not-work-in-wp_query/#post-8546407)
 * The array passed to `value` needs to be the two values you want to compare between.
 * Can you describe what you’re trying to achieve? Might make it easier to offer
   solutions.
 *  Thread Starter [Nimesh Rathod](https://wordpress.org/support/users/nimeshrathod1gmailcom/)
 * (@nimeshrathod1gmailcom)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/between-not-work-in-wp_query/#post-8546476)
 * sure jacob,
 * I have many events with its start and end date like
    event 1 = 2017-11-08 to 
   2017-11-11 event 2 = 2017-11-09 to 2017-11-10 event 3 = 2017-11-06 to 2017-11-
   07
 * as I have run one loop from
    2017-11-05 to 2017-11-15
 * now suppose I will reach at date 2017-11-09 than, I have to display records which
   has this date: so my output event will be :
    event 1 event 2
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/between-not-work-in-wp_query/#post-8548279)
 * Looks OK AFAICT. I’ve often found it helpful to hook the “posts_request” filter
   and output the passed query string for analysis. This often brings to light issues
   that are otherwise unseen. Hopefully this helps.

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

The topic ‘between not work in wp_query’ is closed to new replies.

## Tags

 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 3 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/between-not-work-in-wp_query/#post-8548279)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
