Convert to a date error

i have a the code below which i am passing a form value to
<CFLOCATION
url="CalendarCurrent.cfm?DATE=<cfoutput>#form.Diary_Date#</cfoutput>">
but i am getting cannot convert to a date error, i cannot
change the code below as other pages use it, so how can i change
the cflocation date to match.
i have tried dateformat and lsdateformat any ideas?
<cfif NOT IsDefined("URL.DATE")>
<cfset session.DATE= DateFormat(Now(), "dddd DD MMMM
yyyy")>
<cfset session.SHORTDATE= DateFormat(Now(),
"yyyy-mm-dd")>
<cfelse>
<cfset session.DATE= (DateFormat(URL.DATE, "dddd DD MMMM
yyyy")) >
<cfset session.SHORTDATE= (DateFormat(URL.DATE,
"yyyy-mm-dd")) >
</cfif>

Hi,
You didnt understand some basic stuff, so i tell you what you
should have done:
"The value "27/3/2007" could not be converted to a date."
<cfset myDate="form.Diary_Date">
this line you create myDate parameter with value from form,
Diary_Date field.
you should use # signs because coldfusion doesnt know
otherwise you want to use cf parameters value.
in other words otherwise you are telling coldfusion that
mydate is string containing literaly "form..Diary_Date".
take care you always trim parameter values from forms, same
browsers are so nice to adding extra enter character at end of
field value. so first line goes:
<cfset myDate="#Trim(form.Diary_Date)#">
now, sence myDate parameter is fine, lets focus few minutes
how you split value from myDate to tree different pieces.
GetToken fuction is nice fellow when you want split
preformated string to pieces, preformated mean that string always
look same kind. just like dates. year, month and day are in same
positions at string, while year might be different.
example: 1.1.2007 and 1.1.2003, get it?
usage of gettoken is very simple, you just tell function
first parameter where he has to split you piece of string and
second
you tell number of piece to look for and last you tell what
character is separator of each piece.
so, since date you want to process is "27/3/2007", date is
first, month next and year last.
separator is "/" so, getting month should be like this:
myDate is parameter is strinng to be splitted.
number 2 is order number, month is second piece at string
/ is piece separator.
Following code will give you substring "3" from string
"27/3/2007".
<cfset myDate_Month = "#GetToken(myDate,2,"/")#">
Can you repair your self next two lines?
<cfset myDate_Day = "#GetToken(myDate,1,"\")#">
<cfset myDate_Year = "#GetToken(myDate,3,"\")#">
Cheers
Kim

Similar Messages

  • CAST Not working for me - Arithmetic overflow error converting int to data type numeric - error

    GPM is DECIMAL(5,2)
    PRICE is DECIMAL(11,4)
    COST is DECIMAL(7,2)
    Trying to update the Gross Profit Margin % field and I keep getting the "Arithmetic overflow error converting int to data type numeric" error.
    UPDATE SMEMODETAIL SET SMD_GPM = (SMD_PRICE-SMD_COST) / SMD_PRICE * 100
    FROM SMEMODETAIL WHERE SMD_PRICE<>0 AND SMD_QUANTITY<>0
    Example record:
    SMD_PRICE    SMD_COST    GPM%
    1.8500            1.62                12.4324324324324300
    I added cast and I still get the error.
    How do I format to get this to work?
    Thanks!

    Hi GBerthume,
    The error is caused by some value such as 1000.01 of the expression (SMD_PRICE-SMD_COST) / SMD_PRICE * 100 exceeds the
    precision of the column(DECIMAL(5,2)). The example data doesn't cause the overflow error for the value of the expression is 12.43 which is in the scope of DECIMAL(5,2).
    USE TestDB
    CREATE TABLE SMEMODETAIL
    SMD_PRICE DECIMAL(11,4),
    SMD_COST DECIMAL(7,2),
    SMD_GPM DECIMAL(5,2)
    INSERT INTO SMEMODETAIL(SMD_PRICE,SMD_COST) SELECT 1.8500,1.62
    UPDATE SMEMODETAIL SET SMD_GPM = (SMD_PRICE-SMD_COST) / SMD_PRICE * 100
    FROM SMEMODETAIL WHERE SMD_PRICE<>0-- AND SMD_QUANTITY<>0
    SELECT * FROM SMEMODETAIL
    DROP TABLE SMEMODETAIL
    The solution of your case can be either scale the DECIMAL(5,2) or follow the suggestion in Scott_morris-ga's to check and fix your data.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Arithmetic Overflow error converting float to data type numeric

    Hi,
    Am facing strange issue,I have function which returns money datatype and assigning the return money value to float datatype in table.
    Error msg:
    Msg 8115, Level 16, State 6, Procedure GBCalcCatalogPriceNewV2, Line 204
    Arithmetic overflow error converting float to data type numeric.
    The statement has been terminated.
    Strange thing is the same stored procedure is working fine in production environment,but in the deveopment i see this error.Am scared if the same happens in the production environment.Please advice and advance
    thanks
    Regards
    RAj

    Strange thing is the same stored procedure is working fine in production environment,
    How could that be strange? This is an error that occurs depending on the data. Accidents that are waiting to happen will happen sooner or later.
    Then again, a development database may be more prone to such errors, because data that entered are completely out of whack with real life data. Still it is a warning sign. If you have some place where you convert data from float to numeric, you must consider
    the risk that the float value is outside the range for the numeric data type. How do you prevent that from happening? Maybe a CHECK constraint on the column? Of if the data origins from a money column, use a numeric data type with sufficient precision.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Arithmetic overflow error converting expression to data type int

    Hi
        iam creating on sp for  the  database total size , used mb and  free size .  percentage free . 
     in  this purpose i was creating on sps, with in the sp iam was writing  one select statement . it  statement is    
    SELECT [Drivename] ,[DataSizedUsedMB],[DriveFreeSizeMB],DriveTotalSizeMB,
      CAST( (DriveFreeSizeMB/DriveTotalSizeMB)*  100 AS NUMERIC(5,2))
       As
      [PercentFree] ,[DateRecorded] FROM 
    SELECT SUBSTRING([physical_name],1,1) AS Drivename,
      CAST(((SUM(COALESCE(size,0)))*8)/1024 AS NUMERIC(20,2)) AS DriveTotalSizeMB,
      CAST(((SUM( COALESCE( FILEPROPERTY( [name],'SpaceUsed'),0)))*8)/1024 AS NUMERIC(20,2)) AS DataSizedUsedMB,
      CAST(((SUM(COALESCE(size,0))-SUM(COALESCE(fileproperty([name],'spaceused'),0)))*8/1024)AS NUMERIC(20,2)) AS DriveFreeSizeMB
      ,SYSDATETIME()  AS [DateRecorded]
    FROM sys.master_files 
    GROUP BY SUBSTRING([physical_name],1,1))  AS Data
      it was executive one  server with out error  but the same select  statement is writing antoher server iam geeting  belo error.
    "@ErrorDesc: Line 24 - Line 13- Arithmetic overflow error converting expression to data type int." 
      how to slove this issue..
    please help me...

    Change 8 to 8E0, to make it a float literal. The data type of
    SUM(COALESCE(size,0)))*8)
    is int, since all components are int, and it can easily overflow the size for an int. If you use 8E0, you get a float, and the entire expression will be float.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Arithmetic overflow error converting expression to data type int. Why in this case?

    Hi guys, it is Friday and I am really tired but..
    WITH CTE AS (
    SELECT LEN(CONS_ID) AS PROCA FROM TryCons)
    SELECT SUM(PROCA) FROM CTE
    Why I retrieve
    Arithmetic overflow error converting expression to data type int.
    Len should returns a number and so sum should work. It can be because I am trying to read  500 millions rows? But it wouldn't make sense.. 

    Len should returns a number and so sum should work. It can be because I am trying to read  500 millions rows? But it wouldn't make sense.. 
    If the average length of the field exceeds 4.29, that statement will explode. Since I don't know what's in CONS_ID, I can't say whether it makes sense or not. Although, I will have to say that from my uninitiated position, this seems like an
    accident to happen.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to catch date errors and continue processing in a PL/SQL procedure

    I'm updating a date field with dates constructed from day, month and year fields. The incoming data has many instances of day and month that are not valid dates, ex 11 31 2007. There is no 31st day in November.
    I would like to write a pl/sql script to scan the table containing these values and log the rows that produce conversion errors.
    I thought I could do this with exceptions but there are no exceptions that correspond to the ORA-01847 error for mismatched day and month.
    Here is what I tried (the print procedure is a local wrapper for DBMS_OUTPUT.put_line):
    PROCEDURE date_check IS
    start1 DATE ;
    BEGIN
    select to_date(nvl(yearcollected,'9999') ||'/'|| nvl(monthcollected,'01') ||'/'|| nvl(daycollected,'01'),'YYYY/MM/DD'))) into start1 from incoming_data where id=1 ;
         BEGIN
              update temp_test set test_date = start1 where id=1 ;
         EXCEPTION
              WHEN OTHERS THEN
              print('Date error message from exception block');
         END;
    print('Processing continues after handling date exception') ;
    END date_check ;
    Is there a way to catch this kind of error and continue processing after logging a message?
    -=beeky

    Hi, Beeky,
    There are lots of different error messages associated with bad dates. Rather than try to catch them all, I use a BEGIN ... EXCEPTION block that contains nothing but a TO_DATE call. This is one of the rare occassions when I think "EXCEPTION WHEN OTHERS" is okay,
    The following function comes from a package. If you want to make a stand-alone function, remember to say " *CREATE OR REPLACE* FUNCTION ...".
    --          **   t o _ d t   **
    --     to_dt attempts to convert in_txt (assumed to
    --          be in the format of in_fmt_txt) to a DATE.
    --     If the conversion works, to_dt returns the DATE.
    --     If the conversion fails for any reason, to_dt returns in_err_dt.
    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
    ;

  • Convert String to Date and Format the Date Expression in SSRS

    Hi,
    I have a parameter used to select a month and year  string that looks like:    jun-2013
    I can convert it to a date, but what I want to do is,  when a user selects a particular month-year  (let's say "jun-2013")
    I  populate one text box with the date the user selected , and (the challenge Im having is)  I want to populate a text box next to the first text box with the month-year  2 months ahead.    So if the user selects 
    jun-2013   textbox A will show  jun-2013 
    and textbox B will show  aug-2013..
    I have tried:
    =Format(Format(CDate(Parameters!month.Value  ),  
    "MM-YYYY"  )+ 2  )   -- But this gives an error
    This returns the month in number format   like "8"    for august...
    =Format(Format(CDate(Parameters!month.Value  ), 
    "MM"  )+ 2  )
    What is the proper syntax to give me the result    in this format =  "aug-2013"  ???
    Thanks in advance.
    MC
    M Collier

    You can convert a string that represents a date to a date object using the util.scand JavaScript method, and then format a date object to a string representation using the util.printd method. For more information, see:
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1254.html
    http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.1251.html
    In your case, the code would be something like:
    var sDate = "2013-01-10";
    // Convert string to date
    var oDate = util.scand("yyyy-mm-dd", sDate);
    // Convert date to new string
    var sDate2 = util.printd("mm/dd/yyyy", oDate);
    // Set a field value
    getField("date2").value = sDate2;
    The exact code you'd use depends on where you place the script and where you're getting the original date string, but this should get you started.

  • Convert Char to Date in SQL Server

    Hello Experts,
    I am trying to convert Char to Date but getting error in Universe designer. Can anybody advise please?
    Thanks,
    Ravi

    Hi,
    Try with CAST() and CONVERT() functions. For more information refer use this url : http://msdn.microsoft.com/en-us/library/ms187928.aspx.
    It is more easy to get solution if you can post your query.
    Cheers,
    Suresh Babu Aluri.

  • Converting hexadecimal XML data to a string

    Hello!
    Until now I generated XML data with the FM 'SDIXML_DOM_TO_XML'.
    After that I did a loop over the xml_as_table in which I was casting each line of that table to a string.
    ASSIGN <line> TO <line_c> CASTING.
    After the inftroduction of unicode in our system I get a error:
    In the current program an error occured when setting the field symbol <LINE_C> with ASSIGN or ASSIGNING (maybe in combination with the CASTING addition).
    When converting the base entry of the field symbol <LINE_C> (number in base table: 32776), it was found that the target type requests a memory alignment of 2
    What does it mean? Does somebody have a solution.
    I need this function for sending this XML data as string over a simple old CPIC connection.
    Best regards
    Martin

    Hello Martin
    Perhaps my sample report ZUS_SDN_XML_XSTRING_TO_STRING provides a solution for your problem.
    *& Report  ZUS_SDN_XML_XSTRING_TO_STRING
    *& Thread: Converting hexadecimal XML data to a string
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1029652"></a>
    REPORT  zus_sdn_xml_xstring_to_string.
    *-- data
    *-- read the XML document from the frontend machine
    TYPES: BEGIN OF xml_line,
            data(256) TYPE x,
          END OF xml_line.
    DATA: xml_table TYPE TABLE OF xml_line.
    DATA: go_xml_doc       TYPE REF TO cl_xml_document,
          gd_xml_string    TYPE string,
          gd_rc            TYPE i.
    PARAMETERS:
      p_file  TYPE localfile  DEFAULT 'C:payload_idoc.xml'.
    START-OF-SELECTION.
      CREATE OBJECT go_xml_doc.
      " Load XML file from PC and get XML itab
      CALL METHOD go_xml_doc->import_from_file
        EXPORTING
          filename = p_file
        RECEIVING
          retcode  = gd_rc.
      CALL METHOD go_xml_doc->get_as_table
        IMPORTING
          table   = xml_table
    *      size    =
    *      retcode =
    " NOTE: simulate creation of XML itab
      go_xml_doc->display( ).
      create object go_xml_doc.
      CALL METHOD go_xml_doc->parse_table
        EXPORTING
          table   = xml_table
    *      size    = 0
        receiving
          retcode = gd_rc.
      CALL METHOD go_xml_doc->render_2_string
    *    EXPORTING
    *      pretty_print = 'X'
        IMPORTING
          retcode      = gd_rc
          stream       = gd_xml_string
    *      size         =
      write: / gd_xml_string.
    END-OF-SELECTION.
    Regards
      Uwe

  • Converting Java.util date to XML date in format YYYY-MMM-dd

    I'm using below code to convert java.util.date to XML date
    public static XMLGregorianCalendar toXMLDate(Date dte) {
       try {
       // this may throw DatatypeConfigurationException
       DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
       GregorianCalendar calendar = new GregorianCalendar();
       // reset all fields
      calendar.clear();
       Calendar parsedCalendar = Calendar.getInstance();
      parsedCalendar.setTime(dte);
      calendar.set( parsedCalendar.get(Calendar.YEAR ),
      parsedCalendar.get(Calendar.MONTH),
      parsedCalendar.get(Calendar.DATE ));
       XMLGregorianCalendar xmlCalendar = datatypeFactory.newXMLGregorianCalendar( calendar );
      xmlCalendar.setTimezone( DatatypeConstants.FIELD_UNDEFINED );
      xmlCalendar.setFractionalSecond( null );
       return xmlCalendar;
    I need to get the date in the format YYYY-MMM-dd, but it returns in a format YYYY-MM-dd. Can anyone tell me how can i change the format? Thanks

    >
    The snippet of ApplicationClient where the assignment took place and the syntax occurred were:
    1. DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
    2. DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
    3. Date date = new Date();
    4. CustomerDetail customerDetail = new CustomerDetail();
    5. customerDetail.setCollectionDate(dateFormat.format(date)); //got the above syntax error
    6. customerDetail.setCollectionTime(timeFormat.format(date)); //got the above syntax error
    .....I am running JDK 1.6.0_10, Glassfish v2r2, MySQL 5.0, Netbeans 6.1 on Windows XP platform.The format method returns a String not a Date. Why not just store the Date as is without formatting, and format it when you want to retrieve it from the DB and display it?
    m

  • Unparseable date Error in Mapping in PI 7.1

    I am working on Proxy to SOAP in PI 7.1 version
    I have input date as  2009-05-14T17:00:00-07:00 from ECC and I need to split the date as 2009-05-14 and time as 17:00
    please find the error in mapping below
    Compilation of MM_ECC_to_ISO_ClaimSearch_Req successful Unparseable date: "2009-05-14T17:00:00-07:00" com.sap.aii.mappingtool.tf7.FunctionException: Unparseable date: "2009-05-14T17:00:00-07:00" at com.sap.aii.mappingtool.flib7.DateTransformer.convertDate(DateTransformer.java:72) at com.sap.aii.mappingtool.flib7.DateTransformer.getValue(DateTransformer.java:37) at com.sap.aii.mappingtool.flib7.If.getValue(If.java:35)
    Please let me know how can I get rid of this error
    Thanks
    PR

    >
    PR wrote:
    > I am working on Proxy to SOAP in PI 7.1 version
    >
    > I have input date as  2009-05-14T17:00:00-07:00 from ECC and I need to split the date as 2009-05-14 and time as 17:00
    >
    > please find the error in mapping below
    >
    > Compilation of MM_ECC_to_ISO_ClaimSearch_Req successful Unparseable date: "2009-05-14T17:00:00-07:00" com.sap.aii.mappingtool.tf7.FunctionException: Unparseable date: "2009-05-14T17:00:00-07:00" at com.sap.aii.mappingtool.flib7.DateTransformer.convertDate(DateTransformer.java:72) at com.sap.aii.mappingtool.flib7.DateTransformer.getValue(DateTransformer.java:37) at com.sap.aii.mappingtool.flib7.If.getValue(If.java:35)
    >
    >
    > Please let me know how can I get rid of this error
    >
    > Thanks
    > PR
    You need to convert the source date format into that of target date format....you need to use standard DateTransform function available in Messaeg Mapping......

  • How to convert varchar to date datatype while insert or update in table

    Hai All
    I need to convert to varchar to date.
    I have two Tables T1,T2
    T1 Structure
    Code varchar
    Time varchar
    Date varchar
    T2 Structure
    Empname var
    Empcode var
    Intime date
    Outtime date
    Intrin date
    Introut date
    Att_date
    Now i need to move Time form T1 to T2 Intime,outtime,intrin,introut according some condition
    So now i need to convert Varchar to Date while insert or update
    I have tried something
    Insert into T1 (code,intime,att_date)values
    (code,To_date(Date||time,'dd-mon-yyyy hh24mi'),att_date);
    OR While update
    Update T2 set Outtime=To_date(Date||time,'dd-mon-yyyy hh24mi') where...
    I got an error Ora-01861
    Regards
    Srikkanth.M

    You didn't show any example of your date or time values, butyou might need to add a space between them, like
    To_date(Date || ' ' || time,'dd-mon-yyyy hh24mi')

  • Date time stamp to be converted into only date

    Hi Experts,
    when i am using substirng functoin for converting datetimestamp to date it is giving the following error
    i am using RNIF pip to be converted into IDOC ORDERS 05
    the time stamp value from pip should modified in that so that i can get only the date
    by elemiting the time asscioated with it so i used substring functoin it is giving following error
      /ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:347) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 8 at java.lang.String.substring(String.java:1441) at com.sap.aii.mappingtool.flib3.TextFunctions.substring(TextFunctions.java:33) ... 26 more RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499]
    thanks
    sunil

    Hi,
    Do as follows.
    Use standard date transformation function.In that format of source date give as hh:mm:ss ddMMyyyy and format of targeet date as you wish..It wil solve.
    Please award marks if found useful.
    Thanks
    Hamja

  • Oracle Date error on return parameter

    Hi,
    I'm getting a date parameter from Oracle returned as 0006-08-13, for Aug 13, 2006.
    I've tried a number of things in the SELECT statement, with both to_char and to_date, neither which have been sufficient.
    So I thought I'd try the replace method, but am getting an error.
    I have the following declared to have the parameter returned:
    Date datereq = admsql.getDate(9);
    String dtreq = replace(0,0,2(datereq));Do I need anything else or should I somehow use replace() wrapped around <%=dtreq%> ?
    Do I need to instead cast something to a SimpleDateFormat object in this case?
    Please advise. This is the one maddening area about Oracle!

    Hi,
    I'm getting a date parameter from Oracle returned as
    0006-08-13, for Aug 13, 2006.No, you're not. The date has probably been inserted incorrectly and is wrong in the database. Either that, or you need to learn how to format Java dates into Strings correctly.
    to_char is for converting a database DATE (or NUMBER) to a database character type such as VARCHAR2
    to_date is for converting a character type such as VARCHAR2 to a database DATE type
    I have no idea what it is you're trying to do with replace(); is that supposed to be String.replace()? If so, I don't think the code you've written should compile, and if it did, it still wouldn't do what you want; you can't do a string replacement on a Date object.
    You can get see what's been stored in your DATE (?) column with:
    // fix "your_date_column" and "your_table" and "where_clause"
    SQL = "select to_char(your_date_column, 'yyyy-mm-dd Day Month dd, Year') from your_table where where_clause";
    PreparedStatement ps = connection.prepareStatement(SQL);
    ResultSet rs = ps.executeQuery();
    rs.next();
    String dtreq = rs.getString(1);(Or you could run that SQL statement in SQL*Plus or some other general purpose SQL client; if you're going to program regularly with a database, such a thing is an essential professional tool).
    If the above SQL tells you the date really is Aug 13, 2006, then you need to figure out how to convert Java dates to Strings correctly; if the date is stored incorrectly, then you need to fix your program elsewhere.

  • Exception --- Value can not be converted to requested type.Error Code: 0

    Inside my query, I try to use function,like
    Expression formattedRegDateCol = regDateCol.getFunction("to_char", "YYYY/MM/DD");
    sometimes query works fine and sometimes got following exception, can anyone here help me out..
    Internal Exception: java.sql.SQLException: [BEA][Oracle JDBC Driver]Value can not be converted to requested type.Error Code: 0
    Call:SELECT COUNT(*), to_char(REG_DATE, 'YYYY/MM/DD') FROM SYSTEM_DETAIL WHERE ((REG_DATE BETWEEN {ts '2008-08-10 00:00:00.0'} AND {ts '2008-09-30 23:59:59.0'}) AND (GEOGRAPHIC_ID = 104)) GROUP BY to_char(REG_DATE, 'YYYY/MM/DD') ORDER BY to_char(REG_DATE, 'YYYY/MM/DD') ASC
    Query:ReportQuery(com.cad.registration.RegistrationDetailImpl)
         at com.cad.report.data.DocumentReturnedDataGenImpl.loadData(DocumentReturnedDataGenImpl.java:130)
         at com.cad.report.data.AbstractDataGen.getReport(AbstractDataGen.java:96)
         at com.cad.report.command.ProcessReportRequestOnMessage.run(ProcessReportRequestOnMessage.java:74)
         at com.cad.registration.command.AbstractCommand.execute(AbstractCommand.java:106)
         at com.cad.flow.core.Run.run(Unknown Source)
         at com.cad.flow.core.WorkflowComponent.run(Unknown Source)
         at com.cad.flow.ejbs.WorkflowManagerBean.execute(WorkflowManagerBean.java:238)
         at com.cad.flow.ejbs.WorkflowManagerBean.execute(WorkflowManagerBean.java:135)
         at com.cad.flow.ejbs.WorkflowManager_uh667k_EOImpl.execute(WorkflowManager_uh667k_EOImpl.java:132)
         at com.cad.flow.ejbs.WorkflowManager_uh667k_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:335)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
         at com.cad.flow.ejbs.WorkflowManager_uh667k_EOImpl_1001_WLStub.execute(Unknown Source)
         at com.cad.util.WorkflowProxy.runWorkflow(WorkflowProxy.java:128)
         at com.cad.kbd.messenger.listener.mdb.ReportRequestMDB.onMessage(ReportRequestMDB.java:84)
         at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
         at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
         at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:327)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4072)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:3964)
         at weblogic.jms.client.JMSSession$UseForRunnable.run(JMSSession.java:4490)
         at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:464)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
    Caused by: Exception [TOPLINK-4002] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070620)): oracle.toplink.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: [BEA][Oracle JDBC Driver]Value can not be converted to requested type.Error Code: 0
    Call:SELECT COUNT(*), to_char(REG_DATE, 'YYYY/MM/DD') FROM SYSTEM_DETAIL WHERE ((REG_DATE BETWEEN {ts '2008-08-10 00:00:00.0'} AND {ts '2008-09-30 23:59:59.0'}) AND (GEOGRAPHIC_ID = 104)) GROUP BY to_char(REG_DATE, 'YYYY/MM/DD') ORDER BY to_char(REG_DATE, 'YYYY/MM/DD') ASC
    Query:ReportQuery(com.cad.registration.RegistrationDetailImpl)
         at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:282)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.getObject(DatabaseAccessor.java:988)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.fetchRow(DatabaseAccessor.java:780)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:562)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:441)
         at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:457)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:117)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:103)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:174)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:481)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:825)
         at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllReportQueryRows(ExpressionQueryMechanism.java:791)
         at oracle.toplink.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:518)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:620)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:779)
         at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:451)
         at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:2089)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:993)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:965)
         at oracle.toplink.publicinterface.Session.executeQuery(Session.java:878)
         at com.cad.persistence.toplink.TopLinkPersistenceBrokerImpl.executeQuery(TopLinkPersistenceBrokerImpl.java:420)
         at com.cad.report.data.DocumentSys.getSummitedDocumentNumber(DocumentSys.java:332)
         at com.cad.report.data.DocumentSys.loadData(DocumentSys.java:110)
         ... 24 more
    Caused by: java.sql.SQLException: [BEA][Oracle JDBC Driver]Value can not be converted to requested type.
         at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
         at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
         at weblogic.jdbc.base.BaseData.getTimestamp(Unknown Source)
         at weblogic.jdbc.base.BaseResultSet.getTimestamp(Unknown Source)
         at weblogic.jdbc.wrapper.ResultSet_weblogic_jdbc_base_BaseResultSet.getTimestamp(Unknown Source)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.getObjectThroughOptimizedDataConversion(DatabaseAccessor.java:1038)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.getObject(DatabaseAccessor.java:942)
         ... 45 more

    Here is my code
    ExpressionBuilder builder = new ExpressionBuilder();
    ReportQuery query = new ReportQuery(RegistrationDetailImpl.class, builder);
    query.addArgument("startTime");
    query.addArgument("endTime");
    query.addArgument("lro");
    Expression lroCol = builder.get("lro");
    Expression regDateCol = builder.get(
    QueryConstants.RegistrationDetailQueryConstants.REGISTRATION_NUMBER_COL).get(
    QueryConstants.RegistrationDetailQueryConstants.REGISTRATION_DATE_COL);
    Expression formattedRegDateCol = regDateCol.getFunction("to_char", "YYYY/MM/DD");
    Expression timeExp = regDateCol.between(builder.getParameter("startTime"), builder
    .getParameter("endTime"));
    Expression lroExp = lroCol.equal(builder.getParameter("lro"));
    query.setSelectionCriteria(timeExp.and(lroExp));
    query.addCount();
    query.addAttribute("regDate", formattedRegDateCol);
    query.addGrouping(formattedRegDateCol);
    query.addOrdering(formattedRegDateCol.ascending());
    descriptor.getDescriptorQueryManager().addQuery("testquery", query);

Maybe you are looking for

  • A solution for batch print PDF documents

    Dear,    I use a command line to auto print some PDF documents as below:    C:\>AcroRd32.exe /h /t PDF_file_name printer_name    the printing is no problem.    But when I use the command line to print a large number of PDF files, there are a problem,

  • URI-Access doesn't work

    I use the xml-databases first time (9.2.0.6) - it works very well (also with register schema and the sql-select) - but the access via http://localhost:8080/oradb/etc. isn't possible (with the standard-xdbconfig.xml) - Has anybody an idea, what's wron

  • COGS not capture in COPA

    Hi, I had a scenerio that there is pricing error in SD when the user create the billing documment and the cost of good sold was not capture in the billing document after the user created the condition type. However the invoice cannot be cancelled and

  • "the current system is not the original system" in uccheck

    Hi  Friends, I get a message during the unicode conversion. Can u help me how to rectify this error.And also would be grateful if u can given some links regarding this issue and why this error message is raised. "the current system is not the origina

  • Nested loop join v/s Sort merge

    I have seen that nested loops are better if the inner table is being indexed, because for each outer table row, we are looking for a match in the inner table. But is there any case when optimizer still goes for a nested loop even if there is no index