Maybe I posted to the wrong forum, here is the original post copied from "SQL Server 2005 - T-SQL (SS2K5)"
http://www.sqlservercentral.com/Forums/Topic1211666-338-1.aspx
Good day,
I have a table with a timestamp for each record, I have a need to select the records based on three scenarios:
1. Since Last Year (since 365 days before current day)
2. Since Year to End (starts from Jan 1 of current year)
3. Since Fiscal Year (starts from Nov 1 of current year)
My where clause will need to include this selection criteria. I guess I need to use "case " in it.
Can someone tell me how to write this query?
Many thanks. 😉