Write the following SQL Snippet in Query Editor.
- DECLARE @Year VARCHAR(20)
-
- SELECT @Year =(CASEWHEN (MONTH(GETDATE()))<= 3 THENconvert(varchar(4),YEAR(GETDATE())-1)
- +'-'+convert(varchar(4),YEAR(GETDATE())%100)
- ELSEconvert(varchar(4),YEAR(GETDATE()))
- +'-'+convert(varchar(4),(YEAR(GETDATE())%100)+1)END)
-
- SELECT @Year ASCurrentFinancialYear
Execute the preceding script and check the output,
We can see the current financial year using the preceding query.