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 trialDiego Salazar
2,206 PointsHow could I use a where datetime.month> January and datetime.year>2015 or something like this
How could I do this selection of only year and month of a datetime in a select
1 Answer
John Magee
Courses Plus Student 9,058 PointsThere's a variety of ways to do it.
- You could reference the date - if you're looking for all records in 2015 use > 12/31/2015 on the date field.
- Month returns digit representations of dates - so you don't look for january - you look for 1