Re: datediff
Posted by:
ifa thenb
Date: June 24, 2012 11:51AM
Hi Peter
This worked perfectly. Thanks
One part of the query I don't understand:
How does the DATEFIFF function serve both the IFNULL statement as well as the outside or broader statement.
The IFNULL statement tells mysql to calculated the difference between two dates whenever the dischared date is null, but how does it know to do the same for when the discharge_date is not null? If I remove the IFNULL statement I get:
1+ DateDiff (,admissin_date)
1 + DateDiff( ), admission date )
so somehow, the 1 + DateDiff( IfNull( discharge_date, CurDate() ) portion of the statement is serving both the IFNULL and broader statement
Paul
Subject
Written By
Posted
Re: datediff
June 24, 2012 11:51AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.