Using SQL Server 2005 I have a field that contains a datetime value.
What I am trying to do is create 2 queries:
- Compare to see if stored datetime is of the same month+year as current date
- Compare to see if stored datetime is of the same year as current date
There is probably a simple solution but I keep hitting brick walls using various samples I can find, any thoughts?
Thanks in advance.
Compare the parts of the date: