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

Development Tools

Kevin Naegele
Kevin Naegele
10,868 Points

Filtering data in MySQL.

I am stuck trying to pull data from a table but i keep getting a where clause error.

I have rewriten this in about 30 different ways with no luck. Any thoughts?

SELECT CONCAT(last_name, ', ', first_name), TIMESTAMPDIFF(YEAR, birth, death) FROM president WHERE TIMESTAMPDIFF(YEAR, birth, death) > 64 and birth > (1900-1-1);

2 Answers

The last part of the sentence birth > (1900-1-1) might be wrong unless you are using a function, if that's not the case try tu put the date like this: birth > '1900-1-1';

Good luck!

Kevin Naegele
Kevin Naegele
10,868 Points

i tried both ways... but for some reason the '1900-1-1' now is working.... just not matching the data i was supposed to.