Here I want to check whether date from database lies between financial year or not.
I am using following query to check date but it is working properly for year only. if i want to check according to month and year then i got wrong result.
Here is my query:
SELECT *
FROM Payments INNER JOIN Subsciber ON Subsciber.SubId = Payments.SubId
WHERE DATEPART(YEAR, Payments.SaveOn) BETWEEN 2010 AND 2011
AND DATEPART(MONTH, Payments.SaveOn) BETWEEN 4 AND 3
1 Answer