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 trialCraig Shukie
8,839 PointsSQL 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
1 Answer
Steven Parker
231,236 PointsThe 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
8,839 PointsDoh! Yes that would help!
Thank you for the response!
Steven Parker
231,236 PointsSteven Parker
231,236 PointsPlease show your code and provide a link to the challenge page to facilitate analysis.