•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 397,798 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,372 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MySQL advertiser:
Views: 14191 | Replies: 1
![]() |
•
•
Join Date: Aug 2006
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
Hello,
I was wondering if there anyway to Select rows where the date column falls into a certain range?
For example, heres a table
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 wins
Does anyone know any referrences regarding this issue?
Thanks for reading this,
Bobby
I was wondering if there anyway to Select rows where the date column falls into a certain range?
For example, heres a table
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 wins
Does anyone know any referrences regarding this issue?
Thanks for reading this,
Bobby
•
•
Join Date: Oct 2005
Location: Manchester, UK
Posts: 481
Reputation:
Rep Power: 3
Solved Threads: 31
•
•
•
•
Hello,
I was wondering if there anyway to Select rows where the date column falls into a certain range?
For example, heres a table
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 wins
Does anyone know any referrences regarding this issue?
Thanks for reading this,
Bobby
select * from table where date >= [start date] and date <= [end date]
select * from table where date between [start date] and [end date]
Last edited by pty : Aug 22nd, 2006 at 5:11 am. Reason: added code tags
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MySQL Marketplace
Similar Threads
- select rows divisible by 5 (MS SQL)
- Question about SELECT statement (MySQL)
- Mysql num rows(): Invalid argument (PHP)
- Invision Power Board mysql error when trying to view newly created forums (PHP)
- MySQL, SQL conglutinate date items (MySQL)
Other Threads in the MySQL Forum
- Previous Thread: Accessing Mysql with Servlet.....
- Next Thread: MySQL: index for a very large table


Linear Mode