RE: Days in Month

2006-04-04 Thread George Law
Mike,


Maybe : 

LAST_DAY(date)

Takes a date or datetime value and returns the corresponding value for
the last day of the month. Returns NULL if the argument is invalid.

mysql SELECT LAST_DAY('2003-02-05');
- '2003-02-28'
mysql SELECT LAST_DAY('2004-02-05');
- '2004-02-29'
mysql SELECT LAST_DAY('2004-01-01 01:01:01');
- '2004-01-31'
mysql SELECT LAST_DAY('2003-03-32');
- NULL



 -Original Message-
 From: Mike Blezien [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, April 04, 2006 2:48 PM
 To: MySQL List
 Subject: Days in Month
 
 Hello,
 
 is there a MySQL function to determine the total days of any given
month,
 IE if
 current month is April, is there a function or query to find the total
 days of
 the month?
 
 TIA,
 Mike(mickalo)Blezien
 ===
 Thunder Rain Internet Publishing
 Providing Internet Solution that Work
 ===
 
 
 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Days in Month

2006-04-04 Thread SGreen
Mike Blezien [EMAIL PROTECTED] wrote on 04/04/2006 02:47:50 PM:

 Hello,
 
 is there a MySQL function to determine the total days of any given 
 month, IE if 
 current month is April, is there a function or query to find the 
 total days of 
 the month?
 
 TIA,
 Mike(mickalo)Blezien
 ===
 Thunder Rain Internet Publishing
 Providing Internet Solution that Work
 === 
 

Well, the first place I would have looked is in the manual...

http://dev.mysql.com/doc/refman/4.1/en/index.html

Having skimmed through it at least once (something I recommend that 
everyone does), I know there is a section describing all of the functions 
that work with date and time values...

http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html

where I found a function to return exactly what you were looking for...

http://dev.mysql.com/doc/refman/4.1/en/date-and-time-functions.html#id2691432


Respectfully,

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine