var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Calculate Date when End date May Be Null
I'm trying to calculate the number of days between EITHER date_added and date_removed OR between date_added and today if date_removed is null.
It seems to me that I need, somehow, to get the timestamp returned by unix_timesamp(PR_DATE_ADDED) to be equal to today if it is null.
Been going round in circle with this for a few hours and geeting somewhere.
Anyone any ideas?
Re: Calculate Date when End date May Be Null
I think that 3.22 supports these functions:
SELECT TO_DAYS(IFNULL(date_removed, NOW())) - TO_DAYS(date_added), ...
Managed to get it working using the IFNULL statement.