ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-db
php-db
Re: [PHP-DB] Date question
by Chris other posts by this author
Mar 12 2006 8:13PM messages near this date
Re: [PHP-DB] Date question | Re: [PHP-DB] Date question
Gerry Danen wrote:
>  While I am rebuilding my crashed laptop (the machine that had all my
>  intelligence), I started thinking about a select statement I need.
>  
>  I have log info in a table and want to extract it on a monthly basis. The
>  date field is in yyyy-mm-dd format. What's a good way to select those dates
>  that match 2006-02, for example.
>  
>  I apologize if the solution should be staring me in the face, but all my
>  favorites and help files are toast, until I can restore some of them.

Which database are you using?

Mysql has this: 
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html

Postgresql has:
http://www.postgresql.org/docs/8.1/static/functions-datetime.html

I'm sure others have the same sort of functionality.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thread:
Gerry Danen
Gerry Danen
Bastien Koert
Gerry Danen
Chris
LJ Regalado

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved