List:General Discussion« Previous MessageNext Message »
From:Tonu Samuel Date:August 21 2000 7:37pm
Subject:Re: Dates and Queries
View as plain text  
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 |
+----------------------------------------------------------------+
Thread
Dates and QueriesHunter Hillegas21 Aug
  • Re: Dates and Queriespmax21 Aug
    • Re: Dates and QueriesHunter Hillegas21 Aug
      • Re: Dates and QueriesTonu Samuel21 Aug
Re: Dates and QueriesHunter Hillegas21 Aug
  • Re: Dates and QueriesTonu Samuel22 Aug