List:General Discussion« Previous MessageNext Message »
From:Don Read Date:March 2 2003 12:28am
Subject:RE: Days in a month
View as plain text  
On 02-Mar-2003 Steffan A. Cline wrote:
> Is there a function that I missed for calculating the number of days in a
> month?
> 

TO_DAYS()

mysql> set @b:='2003-02-01';
Query OK, 0 rows affected (0.00 sec)

mysql> set @e:='2003-03-01';
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT TO_DAYS(@e) - TO_DAYS(@b) as FebDays;
+---------+
| FebDays |
+---------+
|      28 |
+---------+
1 row in set (0.00 sec)

Regards,
-- 
Don Read                                       dread@stripped
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)
Thread
Days in a monthSteffan A. Cline2 Mar
  • Re: Days in a monthPaul DuBois2 Mar
  • RE: Days in a monthDon Read2 Mar
    • problem: MySql: Got signal 11. Aborting!Dusan Pavlica3 Mar
      • Re: problem: MySql: Got signal 11. Aborting!miguel sol√≥rzano3 Mar