I have an Oracle Query that goes as follow:
SELECT ...
FROM ...
WHERE ...
AND to_char(a.bill_Date, 'MMYYYY') = '072017'
...
ORDER BY ...
In SQL Server, we have the MONTH() and YEAR() functions.
SELECT ...
FROM ...
WHERE ...
AND MONTH(a.BILL_DATE) = MONTH(GETDATE())
AND YEAR(a.BILL_DATE) = YEAR(GETDATE())
...
ORDER BY ...
Is there something that allows me to apply a Month-Year constraint like Oracle does with to_char through a single step? I have to make this parameterized and maintain compatibility with both databases through a common interface. Now, one would require two parameters and other would just one.