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: Mike Morgan <mmorga2_at_amfam.com>
Date: 1997/08/05
Message-ID: <01bca1ac$235a2b50$7c38c8a5@mxm014pc>#1/1

Kevin,

(1) The 'fm' format is like a toggle, once it is issued it stays in effect until it is issued again. For example:

select to_char(sysdate,'fmMM/DD/YYYY') from dual;

This should yield 8/5/1997

however, if you type:  

select to_char(sysdate,'fmMM/fmDD/YYYY') from dual;

you should see 8/05/1997 because the 2nd "fm" turned off fill mode.

(2) I was able to duplicate your second question. I'd be interested in hearing an explanation myself. For what it's worth, we are using Oracle 7.3.2.3/ SQL*Plus 3.3.2 on AIX 4.1.4

Mike Morgan
Compuware Corp.



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
>
>
Received on Tue Aug 05 1997 - 00:00:00 CDT

Original text of this message

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