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 Today's Report

What exactly am I counting?

I keep getting an error that my count calculation is incorrect. Here's my statement:

SELECT COUNT(status) FROM orders WHERE status = "shipped" AND ordered_on = DATE("now");

What am I doing wrong? I felt like I understood this conceptually but now I'm not sure what is being counted without a schema or table to reference. The error message I got from this was:

You're count calculation was wrong. Was expecting the count of 13.

UPDATE: I eventually got this challenge correct just now. It was correct after I aliased the count function to shipped_today. However the error I got before mentioned that the calculation was wrong. Maybe error handling is a bit off for this challenge?

Theresa Smiley
Theresa Smiley
1,024 Points

I encountered the same error with the following statement: SELECT COUNT(status) AS "shipped today" FROM orders WHERE status = "shipped" AND ordered_on = DATE("now");

1 Answer

Theresa Smiley
Theresa Smiley
1,024 Points

Got it! Missing underscore...