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

Craig Shukie
Craig Shukie
8,839 Points

SQL Challenge issue

Hi,

Can someone tell me what I am doing wrong in this code challenge? I receive results so I know that my query executes, but the count returns 149 and the code challenge states that it only expects 13?

What have I missed / done wrong?

Thanks in advance

SELECT COUNT(*) AS "shipped_today" FROM orders WHERE status = "shipped" AND DATE("now");

https://teamtreehouse.com/library/reporting-with-sql/date-and-time-functions/todays-report

Steven Parker
Steven Parker
231,269 Points

Please show your code and provide a link to the challenge page to facilitate analysis.

1 Answer

Steven Parker
Steven Parker
231,269 Points

The last part of the WHERE clause doesn't seem to be a complete comparison. I would expect to see a date column name being compared to today's date.

Update: now that I see the challenge, I would expect "ordered_on = DATE("now")" instead of just "DATE("now")"

Craig Shukie
Craig Shukie
8,839 Points

Doh! Yes that would help!

Thank you for the response!