Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2005, 11:16 AM
Registered User
 
Join Date: Oct 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Determining a week from current date...

A field of a table of my database contains a bunch of dates. I need to search this field for any dates between the current date and 7 days from the current date. How do I do this? Any ideas?!

 
Old December 2nd, 2005, 09:01 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post
Default

TRY:
SELECT field
FROM table
WHERE field > DATE_SUB(CURDATE(), INTERVAL 8 DAY)
hope this works,
John M.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining date range with JS jfisher911 Javascript 1 September 28th, 2006 04:42 PM
Week number to a date pdistant ASP.NET 1.0 and 1.1 Professional 5 August 17th, 2004 07:44 PM
get the week from the given date Beulah ASP.NET 1.0 and 1.1 Basics 1 September 25th, 2003 11:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.