We have one requirement. Wee need to create a fiscal_week column in SQL_server table.
Table will have data as Normal_date column as fiscal_date and fiscal_year colum which will have year part of the date.
Logic for FISCAL_WEEK is as below.
- FIRST FISCAL WEEK WILL START FROM 1 JAN OF EVERY YEAR AND IT WILL BE TILL FIRST FRIDAY.
- SECOND WEEK STARTS FROM SATURDAY AND IT WILL RUN TILL NEXT FRIDAY.
- THIS WILL GO ON TILL THE END OF YEAR (31 JAN)
We will Have data something as below table.
How would I create query for this ? We will have data from 2010 till 2035 years in the table.