Conversion of DATE Format?
Hi Experts,
Am importing the my_DATE value from front end as in the format of <b>MM/DD/YYYY</b>, but, my_bapi code needs to hv in the format of <i><b>YYYY/MM/DD</b></i>, then only my_bapi gives output!
I hv declared my_date as my_date LIKE RSPARAMS in my_bapi, under TABLES tabstrip.
So, How to convert from MM/DD/YYYY to YYYY/MM/DD? Wht is the FM?
thanq.
Message was edited by:
Srikhar
use offset command to convert desired output
if u want date in dd.mm.yyyy format u can use FM CONVERSION_EXIT_PDATE_OUTPUT u will get ur required date format as u ask dd.mm.yyyy.
FM - CONVERSION_EXIT_PDATE_OUTPUT
data : out_date(10) like char,
in_date(10) like char.
in_date = '10.02.2007'.
*take variables V1, V2, V3.
V1 = in_date+ 0(4).
V2 = in_date+ 5(2).
V3 = in_date+ 7(2).
Concatenate V3 V2 V1 into date separated by '/'.
Now, out_date will have DD/MM/YYYY
Thanks
Seshu
Similar Messages
-
Conversion of Date format(0bill_date) to no of days format
We have a report "customer payment analysis report" with following fields
Customer No , Customer Name , Customer Group , Payment Term , Actual Paid Days, Difference
In the cube we are having 0bill_date(actual paid date) ,but want to convert this 0bill_date(in date format) to Actual paid days( no of days format).
How to get that?
Edited by: ranamk on Jan 13, 2011 8:06 AMHi,
Count the number of paid dates. It will give you the number of actual paid days
Thanks,
Dinesh -
Conversion of date format from DD-MMM-YY to YYYYMMDD
Hi all,
i am getting date from oracle database which is in DD-MMM-YY format. i want to change it to YYYYMMDD format .is there any func module to achieve this.
byehi srikanth,
try this code it is exactly suite u r requiremnt
DATA:STR(8),S1(2),DD(2),MM(2),YY(4).
STR=SOURCE_FIELDS-/BIC-DATEFIELD(if bi7.0 )
STR=TRANS_STRUCTURE-/BIC-DATEFIELD(if BW 3.5 )
SPLIT STR AT u2018-u2018 INTO DD MM YY
SHIFT DD RIGHT DELETING TRAILING SPACE.
SHIFT MM RIGHT DELETING TRAILING SPACE.
OVERLAY DD WITH S1.
OVER LAY MM WITH S1.
CONCATENATE YY MM DD INTO STR.
RESULT=STR.
regards
sasidhar -
Hello,
I am using oracle8i. The date format is not giving the proper date values in XML conversion..
create table test(dt date);
insert into test values(sysdate);
insert into test values(sysdate);
insert into test values(sysdate);
TEST.WORLD> select * from test;
DT
28-NOV-04
28-NOV-04
28-NOV-04
set autoprint on
set long 100000
set linesize 100000
set longchunksize 100000
var g_clob clob
declare
l_ctx dbms_xmlquery.ctxType;
l_clob clob;
begin
l_ctx := dbms_xmlquery.newContext('select dt from test');
dbms_lob.createtemporary(:g_clob,true,dbms_lob.session);
dbms_xmlquery.setdateformat(l_ctx,'yyyy-mm-dd');
:g_clob := dbms_xmlquery.getXml(l_ctx);
end;
Here is the output . It is dispalying the 03 For the month november.
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<DT>2004-03-28</DT>
</ROW>
<ROW num="2">
<DT>2004-03-28</DT>
</ROW>
<ROW num="3">
<DT>2004-03-28</DT>
</ROW>
</ROWSET>When you call DBMS_XMLQUERY.SETDATEFORMAT, you must supply the mask using the syntax defined by java.text.SimpleDateFormat.
You need to use "yyyy-MM-dd".
In your case, "yyyy-mm-dd", the lower case "mm" is the mask for minutes. -
Date format conversion in BEX query level
Hi ,
We had a date field in the numeric format like 735.020 in the cube level, but when we execute the query the values for thsi date field is changed in to date format like 31.05.2013.
we are not having any conversion routines and the date fields are used directly in the query .Hi,
Try the below class file or may be create a method in your controller. It will resolve your problem.
package com.XXX.DateFormatForSAP;
import java.util.Date;
import java.text.SimpleDateFormat;
public class FormatSAPDate {
public static String changeDateFormat(Date sapDate) {
String formattedDate = null;
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
formattedDate = dateFormat.format(sapDate);
return formattedDate;
Try this code and let me know.
Regards
Mukesh -
RE: Oracle DATE data format conversion..
<C.M> Motta's question about dates and oracle>
Dealing with dates and Oracle is somewhat of a nuisance. Oracle is very
particular about how date strings are formatted, and if you get it wrong,
you get the (unhelpful) message that C.M. Motta showed us. However, if
you pass a DateTimeData to Oracle, Forte' does the right formatting for you.
If you do need to format the date prior to interacting with Oracle, use the
following format:
dd-mmm-yy <time component>
You can change the default format, but it is not easy.
If you customise Express generated code that interacts with an Oracle
database, again, make sure that you pass a DateTimeData, and not the
.TextValue.
Good luck!
Richard KirkDate: Wed, 06 Nov 1996 08:18:37 -0500
To: "C. M. Motta" <[email protected]>
From: Jim Milbery <[email protected]>
Subject: Re: Oracle DATE data format conversion..
Cc: [email protected]
Cheers:
Most likely what is happening is that you are using the default date
format of Oracle, and you are sending a four-character year. As follows:
SQL> insert into jimbo values ('01-dec-1997')
2 /
insert into jimbo values ('01-dec-1997')
ERROR at line 1:
ORA-01830: date format picture ends before converting entire inputstring
>
Oracle defaults to a format of 'dd-MON-yy'
You can either truncate the year, or manipulate the date to match the standard
database as follows:
insert into jimbo values (to_Date('01-jan-1997', 'DD-MON-YYYY'))
\jimbo
At 09:21 AM 11/6/96 -0200, you wrote:
Forte Users,
First, Id like to thank all those who answered my question on
droplist & SQL. I got just what I was looking for: its up and runnunig
now.
I have another question: Im trying to insert a DATE into an Oracle
database. The source date is:
data : DateTimeData = new;
data.SetCurrent();
So, when I try to insert data.Value or data.textvalue into DB, I
get the following exception:
ORA-01830: date format picture ends before converting entire
input string.
Are there any suggestions?
Thanks for your help,
C.M. Motta
====================================================================
Jim Milbery
Milbery Consulting Group
132 N. West St., Allentown, PA 18102
O: 610 - 432 - 5350 F: 610 - 432 - 5380
E-Mail : [email protected]
==================================================================== -
Problem with date format conversion
Hi All,
I was trying to load from a flat-file to an ods through psa. the file has a date format which is mm/dd/yyyy. i want to convert that to yyyymmdd. i created a custom object ZDAT for this field of type char with length 10. i wrote a code in transfer routine for the conversion as follows:
DATA : ZT1 LIKE SYST-DATUM,
STR1 TYPE STRING,
STR2 TYPE STRING,
STR3 TYPE STRING.
SPLIT TRAN_STRUCTURE-/BIC/ZDAT AT '/'
INTO STR1 STR2 STR3.
CONCATENATE STR3 STR1 STR2 INTO ZT1.
RESULT = ZT1.
it reported error in PSA records while loading aS " Infoobject /BIC/ZDAT does not contain alpa-conforming value 20050321.
P.s: for this record i was abt to load 03/21/2005 to zdat.
thanks,
anitha.hi anitha!
ok!
in the transferrules you use the ZDAT as an field for date in transferstructure. but in info source use the 0calday.
so now
you need to write your routine in the transfer rules for 0calday which can be derived from zdat which can be derived from the zdat.
so your Transfer structure will be same as
zmid, zmatgrp, zdat, zcid, zloc, zqty
But your Info source must be like
zmid, zmatgrp, 0calday, zcid, zloc, zqty
and in transfer rule i suggest you to use the following code for the 0calday.
DATA : ZT1 LIKE SYST-DATUM,
STR1 TYPE char(2),
STR2 TYPE char(2),
STR3 TYPE char(4).
SPLIT TRAN_STRUCTURE-/BIC/ZDAT AT '/'
INTO STR1 STR2 STR3.
CONCATENATE STR3 STR1 STR2 INTO ZT1.
RESULT = ZT1.
hope it makes things clear....
with regards
ashwin
Message was edited by: Ashwin Kumar Gadi -
Regarding Date Format Conversion
Hi,
In my project i am picking the date from the date picker which is a javascript program . Then i am displaying it on a jsp page .It is coming in mm/dd/yyyy format .I have to change it to dd/mm/yyyy format .
I have the code for date formatting conversion .
What my doubt is whether the code should be written inside the jsp page or in the javascript .
Thanks .Hi
<%@page language="java" import="java.sql.*,java.util.*,java.text.*" %>
<%SimpleDateFormat sdf= new SimpleDateFormat(dd/mm/yyyy );%>
<% java.util.Date temp_date = sdf.parse(PassYourDateHere); %>
use this with your jsp
Regards
Abhijith YS -
Reg : date format conversion from dd.mm.yyyy to mmddyyyy
hi ALL,
is there any function module which can convert date format
from <b>dd.mm.yyyy to mmddyyyy</b>.
Thanks in advanceHi,
Please check the following
CONVERSION_EXIT_PDATE_INPUT Conversion Exit for Domain GBDAT: DD/MM/YYYY -> YYYYMMDD
CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY
SCA1 Date: Conversion
CONVERSION_EXIT_IDATE_INPUT External date INPUT conversion exit (e.g. 01JAN1994)
CONVERSION_EXIT_IDATE_OUTPUT External date OUTPUT conversion exit (e.g. 01JAN1994)
CONVERSION_EXIT_LDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
CONVERSION_EXIT_SDATE_INPUT External date (e.g. 01.JAN.1994) INPUT conversion exit
CONVERSION_EXIT_SDATE_OUTPUT Internal date OUTPUT conversion exit (e.g. YYYYMMDD)
TB01_ADDON
CONVERSION_EXIT_DATEX_INPUT
CONVERSION_EXIT_DATEX_OUTPUT
Hope this would surely help you out.
Thanks and regards,
Varun. -
Date Format Conversion Problem
Hi I am having trouble converting excel files to PDF.
I am in Australia and so we use the date format dd/mm/yyyy.
However when I convert to PDF it changes the date to the American format mm/dd/yyy.
For example if the date in Excel is 07/08/2013 (7th of August 2013) after conversion to PDF it displays as the 08/07/2013 (8th of July 2013).
Can someone please tell me how to get Adobe CreatePDF to convert to the correct date format?DrClap wrote:
From the API documentation for SimpleDateFormat:
"Text can be quoted using single quotes (') to avoid interpretation."
So your format should be:"yyyy-MM-dd'T'kk:mm:ss.SSz"(Note that I added the "z" at the end to handle the timezone part of your input.)From the description of the OPs problem - that of obtaining the "date" information from an XML file - it seems easier to remove the unwanted characters than to add single quotes where needed. -
Date Format Conversion from MM.DD.YYYY to YYYYMMDD
Hi All,
I am trying to load data from r/3, and i have date format as MM.DD.YYYY in source system.how can i convert this into YYYYMMDD format in transfer rules(I know that we have to write a routine in transfer rules).Could anybody help me out pl?..pl give me conversion routine for it.
Here BW Filed is 0DATE and R/3 Filed is ZZDATE.
regards
murali.
Message was edited by: MuraliHi,
Try to under stand what I am asking :
<b>What is the domain(or data type) used for the ZZDATE field.</b>
Ok ,
If some records are having proper format and others are having wrong format, even we canot correct this with routine also. So in this case you have to edit manually at PSA, then do upload.
You are right, when we are populating data to ODS , if there is any wrong format of value, it will not disply the error at the time of loading .It will through the error at the time of activation.
With rgds,
Anil Kumar Sharma .P -
DATE FORMAT Conversion FOR SQL Reports
Hi,
Am building a report and am stuck here where this piece of code that throws the following error
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.
My query goes some thing like this
DECLARE @StartDate varchar(15),
@EndDate Varchar(15)
SELECT @StartDate = '01/08/2014',
@EndDate = '31/08/2014'
SELECT DISTINCT
[Operation] = CASE WHEN p.DATE_OF_START BETWEEN @StartDate AND @EndDate THEN 'Add'
ELSE 'Update' END
FROM SNZ_HR_Reporting_POSMGNT as s
LEFT OUTER JOIN PERSON as p on s.EMP_NO = p.EMP_NO
WHERE s.CHANGE_DATE BETWEEN @StartDate AND @EndDate
The date format in the column DATE_OF_START is like yyyy-mm-dd 00.00.00.000 .
My question is how to convert this format to dd/mm/yyyy format and execute the queries
Many Thanks,
BhanuSQL Date Format:
http://www.sql-server-helper.com/tips/date-formats.aspx
Please Mark This As Answer if it helps to solve the issue -
Date format conversation in OBIEE
Hello guys
I am a quick question about how to stop OBIEE from using to_date conversation? The date format in the db is dd/month/yy, and when I run any report in OBIEE answer using Date columns, it will always convert the format to "dd/mm/YYYY". The sql generated will always have a to_date() in where clause..
Is there a way to not have OBIEE does that and just show the date with format as it is and drop the to_date conversion in SQL?
ThanksI think you are getting confused here. Oracle's default date format is dd-mon-yyyy. So when you run a query like this:
DATE_COLUMN = '01-Nov-2009'
Oracle applies an IMPLICIT data type conversion to your date string and converts it to a date data type. Whether you allow Oracle to do the implicit conversion or do it explicitly like this DATE_COLUMN = To_date('01-Nov-2009', 'dd-mon-yyyy') should always result in the same query performance. When to TO_DATE functions affect query performance? When you apply the function over the DATE_COLUMN like this:
TO_DATE(DATE_COLUMN, 'dd-mon-yyyy') = '01-Nov-2009'
Why? Because indexes on DATE_COLUMN WILL NOT be used unless you have defined a function level index with a index column using the function: TO_DATE(DATE_COLUMN, 'dd-mon-yyyy'). My guess is that your DATE_COLUMN is not a date but a varchar2, therefore when you pass in To_date('01-Nov-2009', 'dd-mon-yyyy') Oracle does an IMPLICIT conversion of your DATE_COLUMN to DATE data type to match the data type of your where condition hence it is taking long to execute as no indexes are used. Can you confirm what is the exact data type of the DATE_COLUMN you are using to filter on? Do you have an index defined in that column? Can you confirm exactly how is the index is defined? Have you ran statistics on the table AND the indexes as well? -
As I opened the places.sqlite with an sqlite-editor I found out that firefox saves the last_visit_date via a timestamp which is 16 digits long. I realized that the first 10 digits are similar to the corresponding unix-timestamp but not equal. So.. how can i convert the firefox-timestamp into a normal date? Or into the corresponding unix-timestamp?
Write a bash script or 'C' program to change the date format and then use the sql update function to receive the stdio output 'where date_field='embeded date value'.
-
Date format conversion in PL/SQL
Hi,
am new to pl/sql can any one please tel me how to wright a function to convert date format.
I have date in database with different formats, the data type of the date in database is 'VARCHAR'. I want to convert the date format to standard format say 'DD-MON-YYYY'.
In database i have different formats of date like 'dd-mon-yyyy',dd/mm/yyyy,dd.mm.yyyy,dd.mm.yy,MON DD,YYYY etc with some other formats also..
Please tel me how to wright a function in pl/sql to convert date in to standard format.
Thanks in advance.Ooops, which idiot stored dates as strings? That was silly.
You'll have to aim to recognise each format... e.g.
SQL> ed
Wrote file afiedt.buf
1 with t as (select 1 as id, '01/02/2008' as dt from dual union all
2 select 2, '14.07.2007' from dual union all
3 select 3, 'APR-21-2007' from dual union all
4 select 4, 'NONSENSE' from dual)
5 -- END OF TEST DATA
6 select id,
7 CASE WHEN regexp_like(substr(dt,3,1), '[\.,\/]') THEN
8 CASE WHEN length(dt) = 8 THEN
9 TO_DATE(dt, 'DD/MM/YY')
10 ELSE
11 TO_DATE(dt, 'DD/MM/YYYY')
12 END
13 WHEN regexp_like(dt, '^([[:alpha:]]){3}-') THEN
14 TO_DATE(dt, 'MON/DD/YYYY')
15 ELSE
16 NULL
17 END as date_dt
18* FROM t
SQL> /
ID DATE_DT
1 01/02/2008 00:00:00
2 14/07/2007 00:00:00
3 21/04/2007 00:00:00
4You're problem will come if you actually have dates stored as both DD/MM/YYYY and MM/DD/YYYY type formats because then you won't know if e.g.
01/02/2007
is
1st Feb 2007 or 2nd Jan 2007
Maybe you are looking for
-
Apple logo comes up but ipod doesn't start
When I turn on the device the Apple logo comes up but the ipod doesn't start and go to the menus it just stays with the logo. When I hold down the play/pause on the click wheel to put it to sleep a symbol of a triangle with an exclamation point in th
-
Multiple DB inserts for 1 Submit
Hello, We're running CFMX 6.1 on Win2003 Servers with Oracle 8.0.3 DB on UNIX. We have free projects available on our website in exchange for a consumer signing up for our email newsletter. Somewhere along the way between almost 2 years ago and just
-
I CAN NOT OPEN THE DOCUMENT PAGE IN CS5 IN NEW DOCUMENTS
I USE PHOTOSHOP CS5 on my mac pro snow leopard. I have a trial edition down loaded and worked once. Now it will not open a new or saved documents or display any pasteboard. The tool bar and basic set up display. Could I have something turned off to
-
Calling BAPI_COMPANYCODE_GETDETAIL from VBA (Excel)
Hi, I've successfully called a number of BAPIs in VBA, however am getting a problem with BAPI_COMPANYCODE_GETDETAIL It doesn't seem to pick up the structure of the tables - the 'Tables' objects just get set to 'nothing' rather than pulling back the s
-
Notification not going.
Hi All, When the review_flag changes to red. i am firing a trigger..trigger getting fired correctly when a status changes. and the trigger will call the workflow process(REVIEW_FLAG_VALIDATE). the process diagram is start-->function-->based on the re