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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Date format for 8/4/97, plus TRUNC('ww') question

Re: Date format for 8/4/97, plus TRUNC('ww') question

From: Chrysalis <cellis_at_iol.ie>
Date: 1997/08/05
Message-ID: <33E78889.278E@iol.ie>#1/1

Kevin Bourrillion wrote:
>
> 1. Why does the date format 'fmMM' work as expected (yielding '8' today),
> but 'fmDD' does not (yielding '04')? Do I really have to do THIS to
> get the date to come out nicely?
>
> TO_CHAR(some_date, 'Dy fmMM/') || LTRIM(TO_CHAR(some_date, 'DD/YY'), '0')
>
> 2. The reference book says TRUNC(some_date, 'ww') should always give a
> Monday. Mine always seems to give a Wednesday. Huh?
>
> Thanks,
> Kevin

  1. Remember that the fm modifier is a "toggle", referring to all subsequent elements in the format mask until a further fm modifier is encountered. So you only need one of them to zero-suppress both day and month. Did you perchance use one for each?
  2. My manual says that the ww mask gived the date relative to the first day of the year, so it will always give a Wednesday for *this* year (but not for next)

HTH.

-- 
Chrysalis

FABRICATI DIEM, PVNC
('To Protect and to Serve')
Terry Pratchett : "Guards Guards"
Received on Tue Aug 05 1997 - 00:00:00 CDT

Original text of this message

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