cancel
Showing results for 
Search instead for 
Did you mean: 

Format Mask with to_char()

Nicolas Dumeige
Esteemed Contributor

Format Mask with to_char()

Hi Gurus,

Does anybody know how to get a proper foratting, i.e. without fm to_char() will display blank space to get even space for every month or day, but it will also display a odd hour format.

See for yourself :
select JOB,WHAT,to_char(NEXT_DATE,'Day DD Month RRRR HH24:MI') WHEN from user_jobs where what like '%P_NEW_MONTH%';

JOB WHAT WHEN
---------- ------------------------------ ---------------------------------
4933 KAGRRST.P_NEW_MONTH_CDE('05'); Saturday 01 May 2004 08:00

select JOB,WHAT,to_char(NEXT_DATE,'fmDay DD Month RRRR HH24:MI') WHEN from user_jobs where what like '%P_NEW_MONTH%';

JOB WHAT WHEN
---------- ------------------------------ ---------------------------------
4933 KAGRRST.P_NEW_MONTH_CDE('05'); Saturday 1 May 2004 8:0
All different, all Unix
1 REPLY
Nicolas Dumeige
Esteemed Contributor

Re: Format Mask with to_char()

Nevermind, I've found it, fm is like a switch, if you call it twice the format mask is off.

For my expemple :
select JOB,WHAT,to_char(NEXT_DATE,'fmDay DD Month RRRR fmHH24:MI') WHEN from user_jobs where what like '%P_NEW_MONTH%';
All different, all Unix