RE: [PHP-DB] Re: select date YYYY-MM mysql help
| From: | Matthew Moldvan | Date: | Fri, 03 Jan 2003 20:29:48 +0000 |
| Subject: | RE: [PHP-DB] Re: select date YYYY-MM mysql help | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-24525@lists.php.net to get a copy of this message | ||
I guess for consistencies sake you can use SELECT * FROM table WHERE date
LIKE '2003-01%' also ... just a thought. :-)
Anyway, glad to help out.
Regards,
Matthew Moldvan
---------------------------------------
System Administrator
Trilogy International, Inc
http://www.trilogyintl.com/ecommerce/
---------------------------------------
-----Original Message-----
From: Max Clark [mailto:max@clarksys.com]
Sent: Friday, January 03, 2003 3:35 PM
To: 'Matthew Moldvan'; DChristensen@theimg.net
Subject: RE: [PHP-DB] Re: select date YYYY-MM mysql help
I ended up using:
SELECT * FROM table WHERE date LIKE '2002-12%';
And:
SELECT * FROM table_name WHERE date BETWEEN '2003-01-01' AND
'2003-01-31';
Thanks again for the help!
-Max
-----Original Message-----
From: Matthew Moldvan [mailto:mmoldvan@trilogyintl.com]
Sent: Friday, January 03, 2003 12:16 PM
To: 'Max Clark'; php-db@lists.php.net
Subject: RE: [PHP-DB] Re: select date YYYY-MM mysql help
Which solution did you end up using? Just curious, I wasn't sure if mine
was correct ...
Regards,
Matthew Moldvan
---------------------------------------
System Administrator
Trilogy International, Inc http://www.trilogyintl.com/ecommerce/
---------------------------------------
-----Original Message-----
From: Max Clark [mailto:max@clarksys.com]
Sent: Friday, January 03, 2003 3:02 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Re: select date YYYY-MM mysql help
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
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php