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 Formatting Dates and Times

STRFTIME Question Issue

I am having issues answering the question immediately following the video introducing the STRFTIME function in the SQL Reporting Course. I believe I am answering the question correctly with my code below, but I am receiving a message that my code is incorrect when I submit my answer. Can somebody please advise which piece of my attached code is incorrect for this question?

Question: In a movies database we have a movies table. It has the columns of id, title, date_released and genre. Write a query that returns the title first and the month and year it was released alias as month_year_released. Dates should look like "04/1983" for April 1983.

My (Incorrect) Answer: SELECT title, STRFTIME("%m/%y", date_released) AS month_year_released FROM movies;

Can you post your code?

Sorry about that, Kris. I just added the question and my code to the original post above.

1 Answer

The Y in the year format should be uppercase for a 4 digit year. Everything else looks good.

Thanks, Kris. That fixed the issue. Much appreciated.