How to get the current month in SQL query?

90 Views Asked by At

I run this type of query every month and I have to change the month number manually for the current-running month.

SELECT * 
FROM table_1
WHERE year = '[current month]'

Is there any way I can automate this process through a query which can fit in the month number automatically?

1

There are 1 best solutions below

0
Sara tabaghchi On

you can use this code for find month

SELECT MONTH(getdate()) AS "Present Month";