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 trialSobin Sebastian
5,348 PointsWhat did i do wrong?
In an ecommerce database there's an orders table with the columns id, product_id, user_id, address_id, ordered_on, status and cost. Count the total number of orders that have the status of shipped yesterday. Alias it to shipped_yesterday.
my answers is SELECT COUNT(*) AS shipped_today FROM orders WHERE status = "shipped" AND ordered_on = DATE("now", "-1 day");
but its saying wrong can please someone help me understand what wrong am i doing here?
https://teamtreehouse.com/library/reporting-with-sql/date-and-time-functions/calculating-dates-2
2 Answers
Andrew Chalkley
Treehouse Guest TeacherThe question asked you to write shipped_yesterday
not shipped_today
:)
Sobin Sebastian
5,348 Pointsops my bad thnx for the help
jcorum
71,830 PointsYes. Go ahead. You found it. And they'll give points!!
jcorum
71,830 PointsSorry, Sobin, my bad too!
A X
12,842 PointsA X
12,842 PointsHey Sobin, I've noticed I've started to experience the same...I'm calling it "Code blindness", which I mean as you're getting like 99% of the problem but then you miss that final 1% because you've been working too much to get the other 99%. I appreciate Treehouse's community for helping with "code blindness". Just to give you my example, it took me a while to see what was the difference between your query in mine in terms of why mine wasn't working:
After I fixed my
ordered_on =
problem, I do still wonder if this query would also work: