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!

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 SQL Basics Finding the Data You Want Filtering by Dates

Jeffrey Vierra
Jeffrey Vierra
25,404 Points

SQL basics: Filtering by dates 1 of 1 objective error.

I am getting this Error while trying to complete the objective

"is Bummer! You're missing the date of the 1st October 2015 ("2015-10-01")"

My code

select * from results where "Hessle" = away_team AND "Hessle" = played_on or "Hessle" >= 2015-10-01;

I typed in the exact same procedure on my local sql workspace and it worked.

3 Answers

Hi Jeffrey,

You only have to check 2 conditions here. If the away_team equals "Hessle" and you have that one. The other is to check if the played_on value is greater than or equal to "2015-10-01" The date should be quoted.

select * from results where away_team = "Hessle" and played_on >= "2015-10-01";
Andy Swinford
Andy Swinford
8,152 Points

Remember that dates need to be in quotes as they are not an integer. See below:

SELECT * FROM results WHERE away_team = 'Hessle' AND played_on >= '2015-10-01'
Jeffrey Vierra
Jeffrey Vierra
25,404 Points

Of course. Cheers. It worked perfectly.