Title: Data compare
Last modified: August 20, 2016

---

# Data compare

 *  [macgregor1314](https://wordpress.org/support/users/macgregor1314/)
 * (@macgregor1314)
 * [14 years, 4 months ago](https://wordpress.org/support/topic/data-compare/)
 * I know it’s probably easy, but it’s very frustrating. Ihave this filter, which
   works:
 *     ```
       function filter_where($where = '') {
           $where .= " AND post_date >= '2012-01-08'";
         return $where;
         }
       ```
   
 * But i can’t make a simple substitution, like
 *     ```
       $weekago='2012-01-08';
   
        $where .= " AND post_date >= $weekago;"
       ```
   
 * which is driving me nuts.
    I’ve tried
 *     ```
       $weekago='2012-01-08';
       $weekago="'" . $weekago . "'";
       ```
   
 * but still doesn’t work.

The topic ‘Data compare’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [macgregor1314](https://wordpress.org/support/users/macgregor1314/)
 * Last activity: [14 years, 4 months ago](https://wordpress.org/support/topic/data-compare/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
