Databases Reporting with SQL Date and Time Functions Today's Report

Michael Nanni
Michael Nanni
7,355 Points

What exactly am I counting?

I keep getting an error that my count calculation is incorrect. Here's my statement:

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

What am I doing wrong? I felt like I understood this conceptually but now I'm not sure what is being counted without a schema or table to reference. The error message I got from this was:

You're count calculation was wrong. Was expecting the count of 13.

UPDATE: I eventually got this challenge correct just now. It was correct after I aliased the count function to shipped_today. However the error I got before mentioned that the calculation was wrong. Maybe error handling is a bit off for this challenge?

Theresa Smiley
Theresa Smiley
1,024 Points

I encountered the same error with the following statement: SELECT COUNT(status) AS "shipped today" FROM orders WHERE status = "shipped" AND ordered_on = DATE("now");

Theresa Smiley
Theresa Smiley
1,024 Points

Got it! Missing underscore...