You are here: Re: first day of month from sql date. « PHP Programming Language « IT news, forums, messages
Re: first day of month from sql date.

Posted by Pedro Graca on 11/20/06 10:17

meltedown wrote:
> If I have an sql date, such as "2006-11-19" is there a way using either
> sql or php date and time functions to get the date of the the first day
> of the month ?

select date_sub(YOUR_DATE_COLUMN, interval day(YOUR_DATE_COLUMN)-1 day)
from YOUR_TABLE;

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация