Some hints to make up for some limited/bad diagnostic messages in the challenge answer engine..
If any of you have gotten this far and are still struggling let me advise you that
some of the Bummer! messages that say something about your "count" being wrong
or unhelpful messages saying error near such and such
will probably not be as helpful in getting to the right answer
as re-watching the video that precedes the challenge question.
This SQL Reporting course (unlike many at Treehouse) does really try to provide
a reasonably tight "coupling" between the SQL code presented in the videos
and what SQL code is expected in the challenges (as least better than using google
to search for relevant SQL code since their are many different SQL language variations possible).
This course tends toward using SQLite mostly,
but the cheat sheets it provides (in lieu of not having a downloadable zip file for the course)
do include links to multiple types/flavors of SQL:
A few "hints' for some of the challenges in the Date and Time functions section:
Link to challenge:
SELECT COUNT(*) AS shipped_today FROM orders WHERE status = "shipped" AND ordered_on = DATE("now");
SELECT COUNT(*) AS shipped_yesterday FROM orders WHERE status = "shipped" AND ordered_on = DATE("now", "-1 day");
Link to challenge:
SELECT title, STRFTIME("%m/%Y", date_released) AS month_year_released FROM movies;
Michael Lefkowitz12,295 Points
I agree with Winthrop. The challenges are poorly worded. They should be written like this:
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 were both ordered_on and shipped today. Alias it to shipped_today.
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 both the status of shipped and were ordered_on yesterday. Alias it to shipped_yesterday.
Amber Touch2,339 Points
I doubt anyone is still reading here, but I agree that these challenges are poorly worded. Since there is no instructor to help the student, and the challenges are extremely difficult in many cases, it would be nice if the error code was more helpful. I'm on the verge of cancelling my account and going elsewhere because I see no point in frustrating myself unnecessarily.
Ben JakubenTreehouse Teacher
I am sorry that this specific challenge was unaddressed for so long! I have just updated this challenge to make it more clear. While teachers are always monitoring courses for problems and opportunities for improvement, we are also now having a small "Code Challenge Health" team proactively identify and fix issues like this one that aren't technically broken but could be improved.