I have the following sybase code that I would like to use in Oracle:
(DATEADD(dd,1-DAY(c_date),c_date)
How could I go about in changing this code up so that it would work in Oracle?
I have the following sybase code that I would like to use in Oracle:
(DATEADD(dd,1-DAY(c_date),c_date)
How could I go about in changing this code up so that it would work in Oracle?
If I understand the SYBASE functions correctly, you code will return the first day of the month in c_date
.
In Oracle we can easily achieve this with the TRUNC() function, passing a month date mask as the format:
trunc(c_date, 'MM')