Re: select date YYYY-MM mysql help
| From: | Max Clark | Date: | Fri, 03 Jan 2003 20:02:05 +0000 |
| Subject: | Re: select date YYYY-MM mysql help | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24522@lists.php.net to get a copy of this message | ||
Thanks everyone for their help!
"Peter Goggin" <pgoggin@smartchat.net.au> wrote in message
news:008f01c2b32a$b50b2500$0301a8c0@petergoggin...
> If mysql has a between function then you could try:
> where date between '2002-12-01'and '2002-12-31'.
> Otherwise try
> where date > '2002-12-01 00:00:00'and date < '2002-12-31 23:59:59'
> Regards
>
> Peter Goggin
> ----- Original Message -----
> From: "Matthew Moldvan" <mmoldvan@trilogyintl.com>
> To: "'Max Clark'" <max@clarksys.com>; <php-db@lists.php.net>
> Sent: Friday, January 03, 2003 9:38 AM
> Subject: RE: [PHP-DB] select date YYYY-MM mysql help
>
>
> > Sounds more like an SQL question than PHP, but try the following:
> >
> > SELECT * FROM table WHERE date LIKE '2002-12%';
> >
> > Regards,
> > Matthew Moldvan
> >
> > ---------------------------------------
> > System Administrator
> > Trilogy International, Inc
> > http://www.trilogyintl.com/ecommerce/
> > ---------------------------------------
> >
> > -----Original Message-----
> > From: Max Clark [mailto:max@clarksys.com]
> > Sent: Thursday, January 02, 2003 5:40 PM
> > To: php-db@lists.php.net
> > Subject: [PHP-DB] select date YYYY-MM mysql help
> >
> >
> > Hi all,
> >
> > I would like to do a query like this from mysql:
> >
> > select * from table where date = '2002-12';
> >
> > However unless I have the complete date '2002-12-26' the query doesn't
> work
> > correctly. What else do I need?
> >
> > Thanks in advance,
> > Max
> >
> >
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
> --------------------------------------------------------------------------
--
> ----
>
>
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>