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!

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

Date challenge - what am I doing wrong?

I entered my answer as:

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

...but I'm getting the message 'Your count calculation is wrong, was expecting 13'.

Can anyone tell me what's wrong in my code?

2 Answers

Hi Anastasia,

The logic for your statement is sound, you’re just not aliasing the COUNT column correctly. Which I think is causing the test to not be able to find the proper column in which to search for the count.

Change it to SELECT COUNT(*) AS shipped_today FROM... and you’ll be all set.

Ahh, ok! Thankyou!