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

I need help please. What am I doing wrong?

I have reproduced the following code but is not working.

SELECT title, STRFTIME("%d/%m/%y", date_released) AS month_year_released FROM movies;

Thanks!

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Lucio Bonforte! It looks like you're doing great. Unlike some other things the formatting string is case-sensitive. So instead of %y, it's looking for %Y. Also, it's only asking for the month and year, not the day too :smiley:

So if I change:

"%d/%m/%y"

To this:

"%m/%Y"

Your code passes with flying colors :tada: Hope this helps! :sparkles:

Adam Pengh
Adam Pengh
29,881 Points

You're adding a day(%d) to your string that isn't needed and %y should be %Y. They only want mm/yyyy.

SELECT title, STRFTIME("%m/%Y", date_released) AS month_year_released FROM movies