Hunter Hillegas wrote:
> Can I nest if statements?
Yes.
> select *, if (status = 'Q', if (quote_expiration_date > NOW(),
> date_format(quote_expiration_date, '%M %D, %Y'), 'EXPIRED') as
> expiration_date, date_format(quote_expiration_date, '%M %D, %Y')) from
> order_line_master;
>
> Basically I want the status column to trigger the if statement...
>
> I get a syntax error from the above...
On first look I see some error with parenthesis there. After "as
expiration_date" you have one opening parenthesis and two closing ones.
--
+----------------------------------------------------------------+
| TcX ____ __ _____ _____ ___ |
| /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Tõnu Samuel |
| /*/ /*/ /*/ \*\_ |*| |*||*| tonu@stripped |
| /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Tallinn, Estonia |
| /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ |
| ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
| /*/ \*\ Developers Team |
+----------------------------------------------------------------+