Welcome to the Treehouse Community
Looking to learn something new?
What is wrong with my code?
"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 today. Alias it to shipped_today"
I entered this but I do not understand what is wrong
select count(*) from orders where status = "shipped" and date("now");
Steven Parker216,149 Points
You forgot the alias, and your date comparison is incomplete.
It looks like junescano got closer, but you wouldn't use "
IS" to compare dates (just a regular "
Also, if you're looking for "today" you wouldn't add that extra argument to subtract a day. That would be if they had asked for "yesterday" (which I think they do in a different challenge).
In future, always include a link to the course page to facilitate the most accurate answers.
SELECT COUNT (*) AS shipped_today FROM orders WHERE status = "shipped" AND ordered_on DATE("now");