I have a column with week number and a column with year number. I want to search into database for a time interval, for example:
If I want to search between a week from this year, and a week from the next year, what query should I use?
If the year was the same that would be easy and my query will look like:
Select *
From mytable
Where (Finish_Week BETWEEN @Finish_Week1 AND @Finish_Week2)
AND (Finish_Year = @Finish_Year)
Simple answer:
This solution assumes @Finish_Year is the second year.
Short explanation: