Re: Getting dates.
| From: | Mike | Date: | Mon, 22 Jan 2001 21:45:43 +0000 |
| Subject: | Re: Getting dates. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-6043@lists.php.net to get a copy of this message | ||
Addressed to: Mattias Hedman <mattias@popwire.com>
php-db@lists.php.net
** Reply to note from Mattias Hedman <mattias@popwire.com> Thu, 12 Oct 2000 09:43:09 +0200
>
> Hello all! I have a problem... I need to fetch data out of a mySQL
> database. The Data should be between 2 specific dates. No trouble so far.
> But my problem is that I need to calculate the start and end date with
> only the week number to my knowledge. Anyone got any ideas?
MySQL includes a week() function. If your week numbers match up, or can be
made to match up easily, you might do something like:
SELECT * FROM table WHERE WEEK( some_date ) = $WeekNumber
See:
http://www.mysql.com/documentation/mysql/commented/manual.php?section=Date_and_time_functions
Rick Widmer
Internet Marketing Specialists
www.developersdesk.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net