-2

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?

APC
  • 144,005
  • 19
  • 170
  • 281
user1753675
  • 145
  • 1
  • 1
  • 10
  • 4
    It would be helpful to describe what this function is doing. I'm not sure I follow what that would be outputting. – Justin Cave Oct 23 '14 at 20:20

2 Answers2

1

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')
APC
  • 144,005
  • 19
  • 170
  • 281
0
(c_date + 1 - extract(day from c_date))
Multisync
  • 8,657
  • 1
  • 16
  • 20