在小于指定时间的表上选择值

I have these mysql table,

 -------------------------------------------------------------------
 |   products_id   |   date_added              |  date_modified    |
 | -----------------------------------------------------------------
 |    1            |   2012-03-31 15:36:01     |  2012-5-03 00:00  | 
 | -----------------------------------------------------------------
 |    2            |   2012-03-31 15:38:01     |  2012-5-04 00:00  | 
 | -----------------------------------------------------------------
 |    3            |   2012-03-31 15:40:01     |  NULL             | 
 -------------------------------------------------------------------

I wanted to display value depending on the selected time on which values is not null.

If date_modified has a date value then use date_modified as its date. If it is NULL then use date_added as its date.

if($_get['duration'] =="0") {
  $duration = <select all regardless of date>;
} 
elseif ($_get['duration'] =="24") {
  $duration = <select all that less than 24 hours>;
} 
elseif ($_get['duration'] =="15") {
  $duration = <select all that less than 15 days>;
}

This is my mysql query,

$catglobal_sql = "select blog_id, global_category_id, products_id, products_currency, products_type, products_name, products_description, products_quantity, products_model, products_image, products_price, products_date_added, products_last_modified, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id, products_ordered, specials_new_products_price, specials_date_added, specials_last_modified, expires_date, date_status_change, status, display_product, case when (specials_new_products_price > 0 and expires_date > Now() and status != 0) then specials_new_products_price else products_price end price from " . TABLE_GLOBAL_PRODUCTS . " where products_name like '%" . $search_key . "%' and products_currency = '" . $currency_key . "' and display_product = '1' and products_status = '1' having price >= ".$pricefrom_key." and price <= ".$priceto_key." order by products_date_added DESC, products_name";

Can't think of a solution for this. Please help.

Assuming you want to use the expires_date date and it is of type date or datetime

$duration = "";
if ($_get['duration'] == "24") {
  $duration = " AND DATE_SUB(expires_date, INTERVAL 24 HOUR) > NOW() ";
} 
elseif ($_get['duration'] == "15") {
  $duration = " AND DATE_SUB(expires_date, INTERVAL 15 DAY) > NOW() ";
}

$catglobal_sql = "select 
    <your_fields>
    FROM " . TABLE_GLOBAL_PRODUCTS . " 
    WHERE 
        products_name like '%" . $search_key . "%' and 
        products_currency = '" . $currency_key . "' and 
        display_product = '1' and 
        products_status = '1' 
        $duration
        HAVING price >= ".$pricefrom_key." and price <= ".$priceto_key." 
    ORDER BY products_date_added DESC, products_name";