Hello, How I get the first and the last day of current month? |
Do you want to get these as dates? Such as: select ymd(year(current date), month(current date), 1) as FirstDayOfCurrentMonat, cast(dateadd(dd, -1, dateadd(mm, 1, FirstDayOfCurrentMonat)) as date) as LastDayOfCurrentMonth Almost I need to put these information like that: Select * from Table where date between firstdayofcurrentmonth and lastdayofcurrentmonth
(17 May '22, 08:08)
robotgestus
Replies hidden
4
For those conditions, I often use the dateformat function: select * from MyTable where dateformat(MyDate, 'yyyy/mm') = dateformat(current date, 'yyyy/mm')
(17 May '22, 09:03)
Volker Barth
|