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: Srinivas CH <chsrini_at_TC4HQ.CMC.STPH.NET>
Date: Wed, 7 Feb 1996 21:09:39 -0500
Message-Id: <9602071548.AA28074@alice.jcc.com>


Hi,

  use the fmt as 'Day' Insted of 'ww'

Then you will get the reselt 13-FEB-94 which is the Sunday. when you truncate the date to the week it will give the date which is nearest to the sunday.
I hope you will get the Result.

--Ch. Srinivas
  DBA
  CMC Limited
  Hyderabad
  INDIA
  emain :- chsrini_at_tc4hq.cmc.stph.net

>
> 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:00 CST

Original text of this message

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