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 trialMohammad Aslam
6,053 PointsHow to format date?
Not sure what the correct query is. Would appreciate any help.
SELECT title, STRFTIME(%m/%Y, date_released) AS month_year_released FROM movies;
SQL Error: near "%": syntax error
2 Answers
Damien Watson
27,419 PointsHi, I'm not sure what the challenge is asking for specifically but the format should be a string, you are missing single quotes. Try adding these:
SELECT title, STRFTIME('%m/%Y', date_released) AS month_year_released FROM movies;
Mohammad Aslam
6,053 PointsThanks
Damien Watson
27,419 PointsWelcome :)
Mohammad Aslam
6,053 PointsMohammad Aslam
6,053 PointsIn 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.