» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > MySQL Forums

MySQL Forums Share Your Ideas and Tips about MYSQL. Ask questions about MYSQL. Table Design and Much More...

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2006, 02:19 PM
rice rice is offline
Junior Member
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
rice is on a distinguished road
Question MySQL Select Date comparisons functions? features?

Hello friends,

I was wondering if there anyway to Select rows where the date column falls into a certain range?

For example, heres a table

Code:
The date field is generated automatically by MySQL with the DATE function

Heres the table:

[user] . [wins]. [date]
bobby.......4..... 2006-08-21
boby1.......3..... 2006-08-22
boby2.......6..... 2006-08-24
boby3.......1..... 2006-08-29
Now I need to filter this data out so that I can have the end user browse weekly results. I'm stuck on a SELECT syntax statement that can pull any rows from any dates ranging from 8-21 to 8-27 (Monday to Sunday this month).

If this was the case, the last row , boby3 who has 1 wins on 08-29 will not be displayed for this current week's result.

I already have this which ranks users OVERALL season wins:
SELECT user, sum(wins) from results GROUP BY user ORDER by wi -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-22-2006, 02:21 PM
gibson gibson is offline
OSP Starters
 
Join Date: Mar 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
gibson is on a distinguished road
Default

Code:

select user
, sum(wins) as wins
from results
where `date` between '2006-08-21' and '2006-08-27'
group
by user
order
by wins


Cheers -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting MySQL & PHP to communicate JCH MySQL Forums 0 05-29-2006 02:52 PM
MySQL 5.1.3-alpha has been released gunet MySQL Forums 0 12-09-2005 04:55 AM


All times are GMT. The time now is 12:11 PM.