Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

MUSTAFA DIRIK
MUSTAFA DIRIK
15,023 Points

What is wrong with my code?

I think there is no mistake but this code gives error "You're missing the value of "2015-09-01".

2 Answers

Joel Bardsley
Joel Bardsley
31,249 Points

For those following along, the task is 2/2 on this challenge: Searching within a range of values

We're back in our sports team database with the results table. The columns are id, home_team, home_score, away_team, away_score and played_on.

There are 30 days in September. Find all the games played in the results table in September 2015

The issue with your query is the values for the BETWEEN operator are inclusive, so your current query would include results played on 31st August 2015 and 1st October 2015 (as well as all those played throughout September).

Just amend the dates in your query to be the start and end dates of September 2015 and you should pass this task. Good luck!

MUSTAFA DIRIK
MUSTAFA DIRIK
15,023 Points

sorry I thought I added. my code was below, on the challenge https://teamtreehouse.com/library/sql-basics/finding-the-data-you-want/filtering-out-or-finding-missing-information-2 2/2

SELECT * FROM results WHERE played_on BETWEEN "2015-08-31" AND "2015-10-01";

and it gives the error: You're missing the value of "2015-09-01"