Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: TRUNC function in SQL*Plus

Re: TRUNC function in SQL*Plus

From: James Ketchum (SSD) <jketchum_at_CENSUS.GOV>
Date: Wed, 7 Feb 1996 10:38:52 -0500
Message-Id: <9602071549.AA28017@alice.jcc.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US