To dd-mon-rr format
i have a varchar format like this 12/08/2006'.
Please tell me hwo to convert it into a date format of 'dd-mon-rr'
Thanks in Advacne
select to_char(to_date('12/08/2006','dd/mm/rrrr'),'dd-mon-rr') from dual
Similar Messages
-
Date validation in "DD-MON-YYYY" Format,
Hi ,
I have created a textbox with date picker as (dd-mon-yyyy) .
Now i want to create a validation on it for the format (dd-mon-yyyy) .
I have created a pl/sql code with type "function returning error text".
Begin
If :P4_END_DATE IS NOT NULL THEN
if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
return 'END DATE should be in "DD-MON-YYYY" Format';
end if;
END IF;
End;
When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
but when i change month like 20-11-2008 , it actually gives error
ORA-01843: not a valid month
Error ERR-1024 Unable to run "function body returning text" validation.Vaibss wrote:
Hi ,
I have created a textbox with date picker as (dd-mon-yyyy) .
Now i want to create a validation on it for the format (dd-mon-yyyy) .
I have created a pl/sql code with type "function returning error text".
Begin
If :P4_END_DATE IS NOT NULL THEN
if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
return 'END DATE should be in "DD-MON-YYYY" Format';
end if;
END IF;
End;
When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
but when i change month like 20-11-2008 , it actually gives error
ORA-01843: not a valid month
Error ERR-1024 Unable to run "function body returning text" validation.The call to 'to_date' is raising an exception when it tries to convert your date, standard PL/SQL exception handling takes over and the rest of your code is ignored.
You could try:
declare
pragma exception_init(invalid_date,-01830);
l_dummy date;
Begin
If :P4_END_DATE IS NOT NULL THEN
l_dummy := to_date(:P4_END_DATE ,'DD-MON-YYYY') then
END IF;
exception
when invalid_date then
return 'END DATE should be in "DD-MON-YYYY" Format';
End;
but even that will not check that the user actually used your desired format - the to_date can be quite flexible e.g. accepting separators other than the '-' that you have declared. In fact, the above would only catch the user entering a 'date' that is shorter than the format string - changing the 'invalid_date' for 'others' would capture more (all!) exceptions.
You probably want to look at using regular expressions to perform the format validation.
Edited by: Andy Hardy on Nov 25, 2008 12:29 PM -
How to convert date into dd mon yyyy format
hi all,
i have a problem in date format i am using date like below .
<%java.util.Date date = new java.util.Date();%>
i am inserting date into a table and its storing like this
insert into tablename (d_date) values (date)
and its inserting date like below
Sun Oct 19 09:05:45 GMT+03:00 2003
i want to fetch date in dd mon yyyy format.
with this format i want to make a select query.i struck with the format conversion.
how to do this.
any comments please.
any helphi all,
i understand now where i am wrong.
the below code is not working why because in my server where i am executing code the regional setting month value is in arabic.
i executed the same code in a different server where date and time jones are english its working fine.
All the problem is in regional setting and not the jsp code.
<%
String whtEverDateFormatYouWAnt = "dd MMM yy";
String str = new SimpleDateFormat(whtEverDateFormatYouWAnt).format(new SimpleDateFormat("EEE MMM dd HH:mm:ss vvv yyyy").parse("Sun Oct 19 09:05:45 GMT+03:00 2003"));
out.print(str);
%>
Thanks a lot for the excellent solution.
Thanks again. -
Convert DD-MON-YYYY format to MM/DD/YYYY
I have an input date variable L_DATE as 11-Aug-2013(DD-MON-YYYY).
In my procedure, I am converting the input date to MM/DD/YYYY format .
The logic I have used for the same in my Stored Proc- COMPARE2 is:
R_DATE := to_char(to_date(L_DATE,'DD-MON-YYYY'),'MM/DD/YYYY');
But this is the error that I get when the SP is run:
ORA-01843: not a valid month
ORA-06512: at "COMPARE2", line 51
ORA-06512: at line 2
Can anyone suggest how to resolve this??Input data doesnt match NLS_DATE_LANGUAGE setting
Consider
select * from v$nls_parameters
where
parameter ='NLS_DATE_LANGUAGE'
PARAMETER VALUE
NLS_DATE_LANGUAGE AMERICAN
select
to_char(to_date('11-MAY-2013','DD-MON-YYYY'),'MM/DD/YYYY') d
from dual
D
05/11/2013
select
to_char(to_date('11-MAY-2013','DD-MON-YYYY','NLS_DATE_LANGUAGE=GERMAN'),'MM/DD/YYYY') d
from dual
ORA-01843: not a valid month
or
The month is not given literally
select
to_char(to_date('11-05-2013','DD-MON-YYYY'),'MM/DD/YYYY') d
from dual
ORA-01843: not a valid month -
Page Item with Date format DD-MON-RR - APEX 32
Hello,
I am passing date parameter but somehow it is not formatting date properly on calendars.
For e.g.
Below is my calendar query
select distinct count(*) knt, initcap(username) username, to_date(to_char(trunc(timestamp),'DD-MON-RR'),'DD-MON-RR') ts from xrx_master_records
group by initcap(username), trunc(timestamp)In above query TS is the date column that results in DD-MON-RR format.
Then I format column on calendar tab as shown below, here is how I am constructing the link.
<!-- <a href="f?p=&APP_ID.:40:&APP_SESSION.::NO::P40_CAL:#USERNAME#:P40_DAILY_DATE:#TS#"
style="color:NavyBlue;
font-weight:bold">#USERNAME#(#KNT#) </a> -->But the issue is - #TS# field shows complete date with time stamp for page item P40_DAILY_DATE. i.e. instead of 21-JUL-10, it shows 21-JUL-2010 12:00:00 AM. That means, it is ignoring calendar query and reads straight from database.
How can I make sure that P40_DAILY_DATE item receives date in DD-MON-RR format?
Then, I plan to use P40_DAILY_DATE to connect with the report region by comparing timestamp column from same table with P40_DAILY_DATE.
Please advice.
Thanks,
RSorry but, I am expecting a more productive feedback than this.
Let me state the obvious that, this forum is the community of SME who are volunteers. It is the precious help they provide with their insight to questions other members have. Due to the simple fact that it is purely a matter of choice whether to reply questions or not, it is perfectly justified that some of questions remain unanswered. I hope you understand this.
And anyway, what makes you think that those question that remain unanswered on this forum, remain open forever? -
Convert date format from 'dd/mon/yy' to 'mon/yy'
I know there's probably a load of questions already on this but I can't locate a simple straightforward explanation with examples on how to change the date 'DD/MON/YY' format to a month/year format 'MON/YY'.
Can anyone assist with a useful response, Thankswoof777 wrote:
Thanks both of you for the prompt responses.
I used the to_char(sysdate,'mmyy') from dual response, but also found the other useful.
Just another quick question, this field was in date format, why did I need to change it to CHAR?DATE datatype have NO format & are stored as BINARY values.
The only datatype that can be presented to screen, CRT, or data file are ASCII CHARACTERS!
Your Mileage May Vary below
19:28:46 SQL> select sysdate from dual;
SYSDATE
2012-08-19 19:28:53
19:28:53 SQL> -
Convert varchar2 field into date formatted: DD-MON-YYYY
Thanks in advance for anyone's help on this matter as I know it takes your time and expertise. I am pretty new to SQL but learning my way through it just have an issue with a text to date field conversion. It is an Oracle 10g database and I am writing in SQL. There is a field called Demand which is formatted in varchar2 format of ddmmyy. There is also a field that is formatted as a date called Payment which is formatted as DD-MON-YYYY.
Essentially I need to do a simple Payment >= Demand, however as you can see that is some issue with that being a varchar2 field. Does anyone know if it is possible to do that type of expression against those two fields. Was thinking about possibly converting the varchar2 to a date but not sure how to get to that DD-MON-YYYY format.
Also there are situations where this Demand field will often times be null as it would have never recieved any outbound correspondence in the past and would not have a date at all.
Thanks
Edited by: user10860766 on Aug 18, 2009 8:14 AM
Edited by: user10860766 on Aug 18, 2009 8:19 AMHi,
It's hard to detect bad dates in pure SQL, especially if you need to be precise about when February 29 is valid.
It's easy with a user-define function, like the one in [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=3669932�].
Edited by: Frank Kulash on Aug 18, 2009 3:50 PM
To create a stand-alone function:
CREATE OR REPLACE FUNCTION to_dt
( in_txt IN VARCHAR2 -- to be converted
, in_fmt_txt IN VARCHAR2 DEFAULT 'DD-MON-YYYY' -- optional format
, in_err_dt IN DATE DEFAULT NULL
RETURN DATE
DETERMINISTIC
AS
BEGIN
-- Try to convert in_txt to a DATE. If it works, fine.
RETURN TO_DATE (in_txt, in_fmt_txt);
EXCEPTION -- If TO_DATE caused an error, then this is not a valid DATE: return in_err_dt
WHEN OTHERS
THEN
RETURN in_err_dt;
END to_dt
/To use it:
SELECT primary_key -- and/or other columns to identify the row
, demand
FROM table_x
WHERE demand IS NOT NULL
AND to_dt ( demand
, 'DDMMYY'
) IS NULL; -
MON/YYYY period format in OFA r12
Hi,
We recently upgraded from 11i10 to r12.1.3. We found recently the period format in Oracle Fixed Assets has changed to 'MON/YYYY' instead of 'MON-YYYY' format since current FY. If I query the fa_calendar_periods (table) i found the period_name column has data in the same MON/YYYY format.
What do I need to change to get the period name format back to MON-YYYY format. Also, I noticed starting next FY, it lists as 'MON/YYYY-YYYY', which is even more confusing for the users,
I doubt this is oracle standard as it is not consistent across modules such as general ledger, project costing etc. I searched on metalink and found none to help.
If anyone has any solution, please advice.
Thanks in advance,
Kwin.little more explanation would help here to address the issue.
drop me the sample xml , template you have to my id, id is in my profile. -
Date format not working in XML Publisher
Hi,
We have applied a date format while formatting the report layout using the Template.
The same is not getting reflected.
The output is as follows : 5/1/2006 0:0:0
i.e date with time stamp.
We require DD-Mon-RRRR format.
The same has been tried using the Text Form Field Options.
When applying the same for Number it works . But in case of Date it does not.
Can anybody who has worked on the same, let us know the appropriate way to do the same.
Thanks,
Angelica.XMLP does not recognized the field as date. The only format recognized as date is
YYYY-MM-DDThh:mm:ss+HH:MM
So, either make the data model to return dates in the above format, and then apply date formatting in XMLP, or do the job on the data model side and return the string in the desired final format (which, again, then will be string, not date for the XMLP) -
HI guys
i got two obiee server running in our env . both are identical . on one server when ever we rite any report with date column in it it comes up with dd/mm/yyyy output on another server if we right any report all the date column comes with dd mon yyyy format .. i want both of them should show date like dd mon yyyy format .. i checked all the conf files are both are looking same still not able to figure out where should i change for this to work .
please let me know if you need more info from my end.
Regards,
DevHI Kishore
Thanks for your reply i checked all the things but with no success. do think there could be any other place where i should check .
1. nqsconfig date format
its same for both the two installations
DATE_TIME_DISPLAY_FORMAT = "yyyy/mm/dd hh:mi:ss" ;
DATE_DISPLAY_FORMAT = "yyyy/mm/dd" ;
TIME_DISPLAY_FORMAT = "hh:mi:ss" ;
2. make sure that you didn't save date format in column properties from front-end
Just checked and we havan't saved anything in column properties .. even i created new report as well but still format was same ..
3. Did you mention anything in connection pool settings to set date format.
no we havan't mention anything in connection pool
4. Make sure that you are connecting to same database, and date format set for date is same here and there
yahh both the two installatiosn are connected to same database .. but not sure about "date format set for date is same here and there
" hw i can check this
finally, check this: http://108obiee.blogspot.com/2009/04/changing-date-format-mask-in-javascript.html
no its not on one column .. its to all the date format columns on all the reports .. so i think its not case with me .
please let me know if you need more info
Regards,
Dev -
Date format changes in the middle of a program execution
In my C code I have a series of select statements.
When I first get a session to the database I use the following command to set the date format
alter session set nls_date_format = 'MM/DD/YYYY HH24:MI:SS'
It works fine for a few queries. After a while during the program execution I see that the date format changes to 'DD-MON-YY' format. This results in a series of error in my code because I expect the date format to always be in the 'MM/DD/YYYY HH24:MI:SS' format.
Any idea why the date format should change all of a sudden in the middle of the program execution.I second the idea that you should always use TO_DATE and TO_CHAR if you want to reliably convert between dates and strings.
Without seeing your code, it is hard to say why your date format is changing, but the most likely reason is that you are changing users somewhere in the code. For example:
SQL> show user
USER is "OPS$ORACLE"
SQL> SELECT sysdate FROM dual;
SYSDATE
11-JUL-2003
SQL> ALTER SESSION SET nls_date_format='dd-Mon-yyyy hh24:mi:ss';
Session altered.
SQL> SELECT sysdate FROM dual;
SYSDATE
11-Jul-2003 10:15:12
SQL> connect jtest/test
Connected.
SQL> SELECT sysdate FROM dual;
SYSDATE
11-JUL-2003TTFN
John -
Date validation in " DD-MON-YYYY"
Hi ,
I have created a textbox with date picker as (dd-mon-yyyy) .
Now i want to create a validation on it for the format (dd-mon-yyyy) .
I have created a pl/sql code with type "function returning error text".
Begin
If :P4_END_DATE IS NOT NULL THEN
if :P4_END_DATE != to_date(:P4_END_DATE ,'DD-MON-YYYY') then
return 'END DATE should be in "DD-MON-YYYY" Format';
end if;
END IF;
End;
When i type in like 20-NOV-08 it gives error as 'START DATE should be in "DD-MON-YYYY" Format',
but when i change month like 20-11-2008 , it actually gives error
ORA-01843: not a valid month
Error ERR-1024 Unable to run "function body returning text" validation.
Edited by: Vaibss on Nov 25, 2008 2:09 AM
Edited by: Vaibss on Nov 25, 2008 2:10 AMHello,
Duplicate post -
Date validation in "DD-MON-YYYY" Format,
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! -
In XML Forms Date Format want to display like this (dd-MMM-YY)
Hi All,
I created one Custom Property for Date and use that property in XML Form Builder. In the RenderList that Date Field Display as (Medium Format) showing like this Apr 21, 2009 Format.
But i requirement is to display Date Field as like this 21-Apr-2009 (DD-MON-YEAR) Format.
In the Custom Property i set the
Additional Metadata (csv): + customFormat=dd.MMM.yyyy but this way is not working for XML Forms.(Refered this SAP NOTES:816761)
when the IE Browser language is English(United States) [en-us] Date Field Display as (Medium Format) showing like this Apr 21, 2009 Format.
But when the IE Browser language is English(canada) [en-ca] Date Field Display as (Medium Format) showing like this 21-Apr-2009 Format. so this way is not a right way..
I need to achieve this.. please help me.. Appreciate for helpful answer.
Regards
Thillai JThillai:
Refer to this post:
https://www.sdn.sap.com/irj/scn/thread?messageID=1166540
Hope this helps! -
Date format in Discovere Reports
We have created a workbook with a parameter which is supposed to show up an LOV for a parameter in the MON-RR format. Now this LOV shows up
correctly in the Discoverer Desktop edition as MON-RR format, but when we view
the same in Discoverer Viewer it shows up as DD-MON-RRRR.
Earlier we had got a partial resolution on this issue (TAR 3891425.996), wherein by changing the ICX
profile value in Oracle Applications, we are able to set the date mask to MON-R
R.
But now the above profile applies to all the reports and all the dates show up as MON-RR, whereas we want to continue showing the date in DD-MON-RRRR forma
t in some of the reports.
How can this be achieved ?HI Kishore
Thanks for your reply i checked all the things but with no success. do think there could be any other place where i should check .
1. nqsconfig date format
its same for both the two installations
DATE_TIME_DISPLAY_FORMAT = "yyyy/mm/dd hh:mi:ss" ;
DATE_DISPLAY_FORMAT = "yyyy/mm/dd" ;
TIME_DISPLAY_FORMAT = "hh:mi:ss" ;
2. make sure that you didn't save date format in column properties from front-end
Just checked and we havan't saved anything in column properties .. even i created new report as well but still format was same ..
3. Did you mention anything in connection pool settings to set date format.
no we havan't mention anything in connection pool
4. Make sure that you are connecting to same database, and date format set for date is same here and there
yahh both the two installatiosn are connected to same database .. but not sure about "date format set for date is same here and there
" hw i can check this
finally, check this: http://108obiee.blogspot.com/2009/04/changing-date-format-mask-in-javascript.html
no its not on one column .. its to all the date format columns on all the reports .. so i think its not case with me .
please let me know if you need more info
Regards,
Dev -
Hi,
Dates in the Query are retrieved in DD-MON-YYYY format. Is there any option to set for retrieving all dates in the desired format?There is currently no preference for formatting dates returned by queries. However, the dates that are returned are formatted according to the NLS_DATE_FORMAT session variable, which can be changed with the following as an example:
alter session set nls_date_format = 'DD-Mon-YYYY HH24:MI:SS';
If you are selecting timestamps, then you need to alter the NLS_TIMESTAMP_FORMAT, etc - see the NLS_SESSION_PARAMETERS view for the different NLS settings.
Maybe you are looking for
-
After downloading 10.4 my itunes wont even open on my computer..we have tried different things to see if it will open, downloaded it again..and still it wont open.
-
Hi Experts, Please check this Developer Trace of Dispatcher, this is stopped, when I am restarting my server, it is giving errors : running but not connected to message server, and running but dialog queue standstill, J2EE service unavilable. trc fi
-
Most annoying bugs and one mighty strange one!
Ok so ive tried using logic 8 for time sensitive projects but ive switched back to 7.2 for now due to a pretty long list of bugs, some of which i outlined in another post. but the most annoying for me are the following. - on closing a project with al
-
What is the use of table control in bdc is it same in module pool table con
Hi, What is the use of table control in bdc is it same in module pool table control? regards eswar
-
Reverse of group by...
Hi Guys... I have the following output... Select code, qty from Mytable; code qty A 1 B 2 C 1But I am looking for a output like below... code qty A 1 B 1 B 1 C 1Kind of reverse of group by... Thanks...