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

Spencer Lebel
Spencer Lebel
3,125 Points

Need helping finding the Count of ordered_on today.

Curious what's wrong with my query. Feel like I'm close and either the COUNT is used wrong or something is off with the DATE function. Thanks

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

1 Answer

Mark Sebeck
MOD
Mark Sebeck
Treehouse Moderator 37,905 Points

Hi Spencer. Yes you are super close! I have a question. Does it make sense to alias a column in the WHERE clause? Wouldn't it be better to alias a column you are selecting? Hope this helps and good luck!