Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: TRUNC function in SQL*Plus
Jim,
Actually, it looks like you're getting exactly what you asked for! Format model 'ww' should return "Same day of the week as the first day of the year", which, in 1994, was a Saturday. So 12-FEB-94 would be the correct truncation of 17-FEB-94 (a Thursday). Looks like you need to use the 'DAY' format model ("Starting day of the week"), which presumably will return Sunday's date, and add a day from there.
HTH,
Jim
On Wed, 7 Feb 1996, Andersen Consultant wrote:
> I am using TRUNC to try and get the Monday of a given week for any date I
> have in my table. TRUNC doesn't seem to be doing as advertised. Could
> anyone tell me if they get the same results, or if I'm reading the
> definiton of TRUNC wrong? Here's an example: select TRUNC (TO_DATE
> ('17-FEB-94'), 'ww') from dual; gives me 12-FEB-94. 17-FEB-94 was a
> Thursday, so the answer should have been 14-FEB-94. Does anyone know what's
> going on here? - Jim
>
Received on Wed Feb 07 1996 - 10:49:07 CST
![]() |
![]() |