Hunter Hillegas wrote:
>
> Whoops...
>
> I posed the wrong query below... Here is my query as it currently stands:
>
> select *, if (status = 'Q', if(quote_expiration_date > NOW(),
> date_format(quote_expiration_date, '%M %D, %Y'), 'EXPIRED'),
> date_format(quote_expiration_date, '%M %D, %Y')) as expiration_date from
> order_line_master;
>
> The nested ifs are causing problems... None of the rows returned have
> 'EXPIRED' in them, though some dates are from weeks ago...
You want to show "EXPIRED" on missed dates? Then your query is still
wrong!
quote_expiration_date > NOW() gives you dates, later than now.
Check also the manual about asking questions. You haven't provided us
information about MySQL version and table structure.
--
+----------------------------------------------------------------+
| TcX ____ __ _____ _____ ___ |
| /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Tõnu Samuel |
| /*/ /*/ /*/ \*\_ |*| |*||*| tonu@stripped |
| /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Tallinn, Estonia |
| /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ |
| ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
| /*/ \*\ Developers Team |
+----------------------------------------------------------------+