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 Reporting with SQL Date and Time Functions Calculating Dates

Wrong count calculation

Hi!

I just miss two test to complete the course, unfortunately I have been stuck to this question a long time without getting what I do wrong

my formula is select count(*) as "ordered_yesterday_and_shipped" from orders where status = "shipped" and date("2021-05-23", "-1 day") When I tried it even on the SQL playground is giving me back 149 results, seems to me I am doing something wrong with the date, even I watched the video times and times I cannot find what I did wrong!

1 Answer

You are so close! Try using 'now' instead of the exact date. Also, you need to name your ordered_on column and set that equal to the date function.