Excel converts numeric values to date

Hi,
I have a JSP page which is sending data to excel.
response.setContentType("application/vnd.ms-excel");
response.addHeader("Content-Disposition", "attachment;filename=\"a.xls\"");
I am using codes above. But excel converts numeric values to date. for example I send "18.5" but excel convert it to "18.May". But when I add " " before the value there is no problem. But I dont want to use this
how can I fix it. Thanks in advance.

hi,
the problem is not with your jsp encoding but with excel settings
enter the mathe-statistics block in your excel program change setting from date to numbers
that is all

Similar Messages

  • How 2 convert numeric value to character value?

    Hi friends,
    I want to convert numeric value to the character value.
    Is there any FM available?
    Points rewared soon.
    Regards
    Ronn

    REPORT ZSPELL.
    TABLES SPELL.
    DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
    DATA : PAMOUNT LIKE SPELL-NUMBER  VALUE '1234510'.
    SY-TITLE = 'SPELLING NUMBER'.
    PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
    WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
    FORM SPELL_AMOUNT USING PWRBTR PWAERS.
      CALL FUNCTION 'SPELL_AMOUNT'
           EXPORTING
                AMOUNT    = PAMOUNT
                CURRENCY  = PWAERS
                FILLER    = SPACE
                LANGUAGE  = 'E'
           IMPORTING
                IN_WORDS  = T_SPELL
           EXCEPTIONS
                NOT_FOUND = 1
                TOO_LARGE = 2
                OTHERS    = 3.
    ENDFORM.                               " SPELL_AMOUNT

  • How can change numeric value to date format? example value 1070131(CYYMMDD)

    in the datatable can i change numeric value to date format . in database date value is like 1070131 (CYYMMDD). I want to see 31/01/07(DD/MM/YY) or 31 Jan 07 . Is it possible?
    Thanks,

    Did you solve your problem?

  • Plsql query converts numeric value or currency(rupees) to English words

    Hi,
    I Need a plsql procedure/function query that converts numeric value or currency(rupees) to English words.
    Please help .that is very very important and urgent for me.
    Thanks in advance.
    Regards,
    Karthik T

    that is very very important and urgent for me. Then help yourself by looking on all over internet :
    http://www.google.nl/search?hl=nl&q=oracle+numeric+word&meta=
    Or by using the search feature against the forum :
    http://forums.oracle.com/forums/search.jspa?threadID=&q=%2Bnumber+%2Bword&objID=f75&dateRange=all&userID=&numResults=15
    That would be faster.
    Nicolas.

  • MS Excel automatically converts numeric fields to date format

    I have at least 2 different spreadsheets where this happens.  I maintain them for months, adding, changing, deleting data.  They contain lots of data elements (numeric, text, date, etc).   Some columns are all numeric, some all dates,
    etc.  Then suddenly when I open the spreadsheet, my numeric formatted data has been converted to date format.  I see lots of # signs in cells, which is an indication that this happened, and selecting an affected cell shows a date, generally in the
    early 1900s, depending on the original numeric value that was in the cell.  I convert the fields back to numeric, but sometime later the same problem occurs -- numeric fields are now date formatted.  I cannot identfy any specific change that I make
    that would cause this.  And I only recognize it as having occurred when I open the spreadsheet, not anytime during its maintenance.  I am using MS Excel 2007 SP2 in a Windows XP SP3 environment.  The machine is well maintained and updated /
    kept current by our corporate IT group.  I have done numerous Internet searches and cannot find anything like this in any other blog.  Thanks for your help.

    Hi,
    Were some of the these data imported from a .csv file? As far as I know, data formats cannot be saved in .csv file. If this is the situation, try this:
    Save a copy of your .csv file changing the extension of your file from .csv to .txt
    open excel.
    go to DATA --> Import external data --> Import data --> browse to find the .txt file you made earlier
    The text import wizard should open.
    Click on delimited, click next
    click comma, click next
    You should now see all columns appear with heading GENERAL --> highlight the columns with the values that are changing to date and click TEXT (top right) instead. The heading of these columns should now change to TEXT.
    click finish
    Excel will now treat the column as text when it imports the data and will not change them to dates
    If this is not the situation, this issue might be caused by some add-ins.
    Start Excel in safe mode:  Press and hold the
    CTRL key, and then click the Excel program to start. Then, click File > Open to open the Excel file.
    If the problem does not occur in the safe mode, this issue might be related to some third-party add-ins in the Office program, we can try to disable them.
    Best Regards,
    Sally Tang

  • Please help in converting double value to date..

    Hi Friends,
    I have a double value which I am getting from reading the excel file using Apache POI Classes.
    For example: The date in the excel cell is 12/18/2008 and when reading the cell using the POI class it is returning 39800.0
    instead of returning the original excel date 12/18/2008.
    Basically I need to convert back the double value 39800.0 to 12/18/2008.
    Did anybody face issue like this, or is there any other way to get date value from excel files.
    I am posting part of my code for reference..
    public String getCellValues(HSSFCell cell) {
              if (cell.getCellType()==0 ) {
                   return ""+cell.getNumericCellValue();
              if (cell.getCellType()==1 ) {
                   return cell.getStringCellValue();
              return "";
    Thanks in Advance
    James George.

    Cells have a type (string, numeric, blank etc) and that's about it as far as content is concerned.
    But they do have a style.
    cell.getCellStyle() will return you an HSSFCellStyle. And this class has a method getDataFormat() which returns a short value. I guess you might attempt to guess that a numeric value "was" a date from the fact the returned value is one of the known date formats.
    http://poi.apache.org/apidocs/org/apache/poi/hssf/usermodel/HSSFDataFormat.html
    In other words if you look at
    short format = cell.getCellStyle().getDataFormat();and you see a 2 you know you are looking at an ordinary ("0.00") number value. If you see a 14 you are looking at a ("m/d/yy") date. And so on for the rest.

  • Convert numeric value to display as text based on record in another table? ASP/VB

    I have an orders table:
    orderID (PK)
    pickupname
    pickupaddress
    pickupregion (numeric)
    pickuppostcode
    deliveryname
    deliveryaddress
    deliveryregion (numeric)
    deliverypostcode
    I also have a regions table:
    regionID
    regionname
    On my ASP page, I would like to display the pickup and
    delivery addresses as
    follows, but also need this to be within a repeat region as I
    am displaying
    a number of orders on the page (I have wrapped what I want in
    the repeat
    region in dashes, below):
    ---------Repeat Region Start-----------
    Pickup Address:
    Name
    Address
    Region (pickupregion)
    Postcode
    Delivery Address:
    Name
    Address
    Region (deliveryregion)
    Postcode
    --------Repeat Region End------------
    As it displays at the moment, I get this (using sample data):
    ---------Repeat Region Start-----------
    Pickup Address:
    Joe Bloggs
    High Street
    12
    HT12 5TY
    Delivery Address:
    Jane Bloggs
    The Mall
    33
    DT6 5TG
    --------Repeat Region End------------
    Is there any way to convert these numeric values to the
    actual region name
    but to keep it within one recordset so that I can use the
    repeat region? I
    tried creating a recordset for regions (SELECT regionID,
    regionname FROM
    tblRegions WHERE regionID = pickupregion OR regionID =
    deliveryregion), but,
    because I'm not repeating this region, it just displays the
    same regional
    name for every order, albeit the first record returned does
    contain the
    correct values! :o)
    I was thinking about some kind of inner join, but it's having
    two numeric
    region fields in the orders table that is causing me
    headaches! PS. I need
    to keep the two addresses within one orders table - I had
    thought of that!
    Got me a bit stumped, I have to say. Any help would be
    greatly appreciated.
    Thanks.
    Regards
    Nath.

    I've tried this one already.
    I tried to leave it blank, & nbsp ; , text,... but the problem is that our lov is build by a function and it always returns a query, so the LOV is never null.
    I figured something out: made a process after header that has some cursors to get the values from the database and changed the item to a simple display as text-field. There were only 4 that were wrong, so it wasn't to much work.

  • Function module to convert float value to data type 'dec'

    Hi experts,
      In a report i need to convert float value to the data type 'DEC'. How to convert it. Is there any function module for this conversion.
    Thanks and Regards,
    Vaibhav Tiwari.

    Hi ..
    We can do like this...
    Data : V_float type F value '12345.67'.
    Data: V_dec type P Decimals 2.
    Write:/ V_float exponent 0. "This will display it like Type P
    or
    Write V_float to V_dec EXPONENT 0.
    Write:/ V_dec.
    reward if Helpful.
    <b></b>

  • How do you convert numeric values into english words?

    I am interested in creating a field in adobe acrobat that references a total dollar amount field. I want the java script to convert the numeric number into a written word, such as $59.59 as Fifty Nine and 59/100. I have no experience writing java script code and would really like some help on how this can get done. Its also important to embed in the programming that if their is no numeric value to reference, then nothing get referenced. This means an empty text box. Thanks for any help.

    Im using the below script...... I'm a complete novice at this and helping a friend out with it.
    Any info is appreciated.
    aTens = [ "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"];
    aOnes = [ "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine",
      "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen",
      "Nineteen" ];
    function ConvertToHundreds(num)
       var cNum, nNum;
       var cWords = "";
       num %= 1000;
       if (num > 99) {
          /* Hundreds. */
          cNum = String(num);
          nNum = Number(cNum.charAt(0));
          cWords += aOnes[nNum] + " Hundred";
          num %= 100;
          if (num > 0)
             cWords += " and "
       if (num > 19) {
          /* Tens. */
          cNum = String(num);
          nNum = Number(cNum.charAt(0));
          cWords += aTens[nNum - 2];
          num %= 10;
          if (num > 0)
             cWords += "-";
       if (num > 0) {
          /* Ones and teens. */
          nNum = Math.floor(num);
          cWords += aOnes[nNum];
       return cWords;
    function ConvertToWords(num)
       var aUnits = [ "Thousand", "Million", "Billion", "Trillion", "Quadrillion" ];
       var cWords = (num >= 1 && num < 2) ? "Dollar and " : "Dollars and ";
       var nLeft = Math.floor(num);
       for (var i = 0; nLeft > 0; i++) {
           if (nLeft % 1000 > 0) {
              if (i != 0)
                 cWords = ConvertToHundreds(nLeft) + " " + aUnits[i - 1] + " " + cWords;
              else
                 cWords = ConvertToHundreds(nLeft) + " " + cWords;
           nLeft = Math.floor(nLeft / 1000);
       num = Math.round(num * 100) % 100;
       if (num > 0)
          cWords += ConvertToHundreds(num) + " Cents";
       else
          cWords += "Zero Cents";
       return cWords;
    You can use the following script for the custom calculation for the words field when the number field is named "Number":
    event.value = "";
    var f = this.getField("Number");
    if(f.valueAsString != "") {
    event.value = ConvertToWords(f.value);

  • Convert numeric values in colomn into names

    Hi experts,
    Here's the situation (probably very easy to solve but could only sort it out for month's, date's etc);
    Colomn name: Gender
    Values: 0 (=female), 1 (=male)
    I want to convert these 0 and 1 into a new colomn with the genders in names instead of numbers so i can make a proper merge in Word.

    You can do it with a simple CASE WHEN Statement:
    SELECT *
    ,CASE WHEN Gender = 0 THEN 'female' ELSE 'male' END As GenderName
    FROM yourTable
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Excel Storing Numeric values as String when send via Email in SAP

    I am using Function Module SO_NEW_DOCUMENT_ATT_SEND_API1 to send an EXCEL file via email.  Everything is working fine but when I open the spreadsheet I'm unable to use EXCEL Autosum command on my numbers.  It looks like my numbers may be in string format.  I tried numerous things in EXCEL to convert the numbers to string with no luck.  If I re-enter the number then the autosum works but I don't want to do that on a large report.  Has anybody encountered this problem and be willing to give me some help on resolving this issue if it can be resolved?

    Hi,
    Have a look at program Y_R_EITAN_TEST_10_02 .
    It is also sending CSV using cl_bcs (using the rules of CSV http://en.wikipedia.org/wiki/Comma-separated_values)
    see form FORM mail_1_prep_3
    Regards.

  • How to convert string value to date

    hi,
    in my application user enters the date in dd/MM/yyyy formatt..before submtiing to some external server i haveto formatt it to MM/dd/yyyy format bcos it accepts olny this formatt.when i retrieve the string date in my jsp using Sring date = req.getParameter();
    i want to convert this date to MM/dd/yyyyy formatt.
    Regards,

    Sring date = req.getParameter();
    string formatted = date.substring(0,3) + "/" + date.substring....
    ?

  • Numeric Values Converted to Scientific Notation

    My BPEL process converts numeric values to scientific notation (eg. 12345678 is converted to 1.2345678E7). This then causes problems when I try to perform any mathematical operations on these values during an XSL transformation (output - NaN)
    Is there any way I can stop this data conversion?
    This occurs with BPEL 10.1.2.0.2. I'm loading the data from an Oracle 9.2 database using the DbAdapter.
    I've written an XSL routine to convert these values back to the correct decimal notation, but would prefer to stop this happening rather than workaround the problem.

    On further investigation, this occurs for values loaded from Oracle FLOAT database type.
    The XSD generated for the DbAdapter uses type xs:double for this field, but I've also tried changing this to xs:decimal & xs:float and still get the same problem.

  • Change a numeric value to a date field

    If someone could please help I would appreciate to know how to change a numeric value to date value. Example: I ave a number 20080312 and I would likefor the field to read as follows in a date format, 03/12/08. i am not sure how to convert.
    Thanks Jim Dyer

    Hi Use,
    CDate("20080312");
    Regards,
    Vinay

  • Converting the string value to data format

    Hello Everyone,
                                  Please guide me in converting the value to date format.
    from source i'm getting the value (which is acchally a data value) '20070730'.
    I need this value to be in date format '2007/07/30'
    Please help me in getting it done.
    thank you

    Hi
    Code Snippetselect cast('20070730' as datetime)
    Note : beware of collation used in your SQL instance or your database.
    Jean-Pierre

Maybe you are looking for