RE: [PHP-DB] figuring out number of months between two dates

2002-04-02 Thread Rick Emery
il 02, 2002 2:28 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] figuring out number of months between two dates I'm trying to get PERIOD_DIFF to work in my quest to count months between dates. I've run into a stumbling block: LEFT(CURRENT_DATE,7) produces 2002-04, as you would expect. L

Re: [PHP-DB] figuring out number of months between two dates

2002-04-02 Thread Remco Oosten
Does this help? select 12*(year(current_date)-year('2001-03-02'))+(month(current_date)-month('2001- 03-15')); the result is 13. But it's quite a large query. - Original Message - From: "John Hughes" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 02, 2002 9:56 AM Subje

Re: [PHP-DB] figuring out number of months between two dates

2002-04-02 Thread John Hughes
I'm trying to get PERIOD_DIFF to work in my quest to count months between dates. I've run into a stumbling block: LEFT(CURRENT_DATE,7) produces 2002-04, as you would expect. LEFT(week_date,7) WHERE week_no = '1' produces 2001-08, again as expected (see table below) But PERIOD_DIFF(LEFT(CURRENT