+ 1
SQL query
Select sum(overtime_hour) From table_name Where date>=(first day of the month) How to get first day of the month?
2 Respostas
+ 7
Why can't you just write the specific date you need?
where date >= '01-06-2018'
+ 5
There is no universal solution to define the first day of the month with SQL dynamically.
It’s depends on the database management system.
MS SQL Server or Oracle or MySQL has own function to get date or parts of the date, but no function exist for this task.
you have to write a function or procedere to get the value of the first date of the month dynamically.