I found the error.  I was using "" around the "+" where I should have been
using '', like '+'.

SELECT
IFNULL(IF(CMBYR=CMEYR,CMBYR,IF(CMEYR="+",CONCAT(CMBYR,CMEYR),CONCAT(CMBYR,'
- ',CMEYR))),' - ')
FROM
TABLE;

Thanks for your help.

John Halladay

-----Original Message-----
From: Boulat Khakimov [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 09, 2001 2:48 PM
To: [EMAIL PROTECTED]
Subject: Re: Nesting


John Halladay wrote:
> 
> I'm getting a warning that says "the supplied argument is not a valid
MySQL
> result resource."
> 
> Here is the SQL that I'm trying to write in a php document.
> 
> SELECT
IFNULL(IF(CMBYR=CMEYR,CMBYR,IF(CMEYR="+",CONCAT(CMBYR,CMEYR),CONCAT(CMBYR,'
> - ',CMEYR))),' - ')
> FROM
> TABLE;
> 
> Is it not possible to nest an "if, then, else" statement?
> 
> Thanks.
> John Halladay
> 

Yes it is possible, I was nesting if inside another if w/o any problems,
there is probably something wrong with your syntax . Post the full query
maybe then I'll be able to help you.



Regards,
Boulat Khakimov


-- 
Nothing Like the Sun

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to