View Single Post
  #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
  Webmaster Forums - View Single Post - MySQL Select Date comparisons functions? features?
View Single Post
  #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