Exporting SQL data to Excel 2010 files - Excel sets all columns to DT_WSTR, ignores numeric or currency

It looks like this has been a problem since forever, but I'm hoping someone has a solution.  I'm exporting SQL data to an .xlsx file.  I have the columns in my query set to the appropriate values, e.g. SELECT Cast(column1 AS nvarchar()) 'column1',
Cast(column2 as currency) 'column2'.  I have a spreadsheet and I've set the data type for each column.  I have an OLEDB connection manager with the connection string of
Data Source=C:\MyFile.xlsx;Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties="Excel 12.0;";  When I look at the Advanced Editor of my OLE DB Destination Component, I see that all the Input Columns are of the correct datatype, but
all the External Columns are of datatype DT_WSTR.  
How can I get my numeric, currency, date fields to be written to Excel as numeric, currency, date?  Right now they all get written as text, any numbers get single quotes put in front of them so they are treated as text.  
I'm using SSIS 2008 R2.
I don't get it, SQL and Excel are both Microsoft, why is it so hard to get them to work together?!

Hi,
converting to DT_WSTR because you are converting this into nvarachar in your select statement in oledb source.
are you looking into the oledb destination or Excel destination for data types.
please remove the casting from your select and create the new table as showing in the following snapshot:
http://zaimraza.wordpress.com/

Similar Messages

  • Error (IES 10901) (WIS 10901) when using Excel 2010 file as data source..

    Hello,
    I have a annoying issue with using an excel 2010 file as a data source for a universe. Here is the background information.
    Setup.
    Client: Laptop running Win XP 32bit, Client tools installed with SP2 v9 (latest)
    Server: Win 2008 x64, BOE 4.0 SP2 v9  (latest)
    Task:
    1. On Client, with information design tool, created Project, DB Connection, Data foundation using an excel source on a share
    server\share\data.xlsx
    2.. Published everything to Repository
    3. Try to load univerise in Web Intelligence via creating a new report. I Drag accross the dimensions. When i go to preview data recieve error
    Database error: [Microsoft][ODBC Excel Driver] External table is not in the expected format.. (IES 10901) (WIS 10901)
    4. If i change the excel file to a 2003 format *.xls it all works correctly. Issue being that 2003 cannot hold as much data as a 2010 file so i need to use 2010.
    Extra Notes:
    1. Both the client and server have the latest Access drivers http://www.microsoft.com/download/en/details.aspx?id=13255
    2. Both client and server have a system DSN setup using the 32bit ODBC, same DSN names to the network share.
    3. The data excel source sits on the server on a share.
    4. I am believing that the isssue is within the area of BOE as when you connect to the excel file via ODBC using crystal 2011, you need to right click on the connection and tick "System Tables" to be able to use the excel 2010 file. The BOE Information design tool does not seem to have this option??
    Any advice with this would be great?
    thanks
    david

    Issue Resolved:
    Install
    Access Database Engine 2010 Service Pack 1 on the server
    http://support.microsoft.com/kb/2460011
    Reboot server once completed.

  • How can we export the data from OAF Page to Excel instead of .csv or .txt

    Hello,
    How can we export the data from OAF Page to Excel instead of .csv or .txt
    When i click on the export button it is exporting to txt file, But i need to export the data into Excel by default
    Please help me
    Thanks in advance
    Thanks,
    Raju
    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju
    Edited by: 1006649 on May 21, 2013 10:55 AM

    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju

  • How to export the data to Multiple sheet in Excel

    Hi,
    How can I export the data to multiple sheets in excel using Crystal Report XI.
    Thanks,
    Baski.
    Edited by: J_Baskaar on Mar 31, 2010 8:14 AM

    One of the 3rd-party Crystal report schedulers listed at http://www.kenhamady.com/bookmarks.html allows you to burst a report so that each group at level 1 becomes a separate worksheet inside a single workbook.

  • Excel 2010 file doesn't open when double clicking directly the icon

    Brand new computer, Windows 7 and Office 2010.
    I read all the threads, tried everything, DDE was unchecked, added/changed registry lines... but still cannot open directly Excel files directly from the icon.
    Thanks for your help.

    Hi, just ran across your post.  I am running Windows 7 (32 bit), MS Office Professional 2010.  We use a LabVIEW program to access data from Oracle and then update using Excel 2010 files.  The data downloads and the files update, sometimes. 
    When I have issues, I get a pop up window that says the Excel 2010 file is being saved, but it never closes.  I have to hit "cancel" and the program continues.  Why this is relevant to the original question is that when I go to try and open one of
    the Excel files that has updated correctly, I get the dreaded blank screen where the data should be.  Some of the Excle functions are active, but the deteriorate and then I have to close the file using cntrl-alt-delete.  I have Excel 2010 as an option
    when it asks for the default program to save.  On a whim, I downloaded the Java Open Office.  It actually works and I can open these Excel files that perviousely went into vapor lock, but I still have issues when I run the LabVIEW update program. 
    I would rather make MS Excel 2010 work correctly.  We have a corporate version of Office 2010 and the "fix" function has been disabled.  I submitted an internal help ticket, for both issues, but no response from our corporate IT group.  Any
    suggestions?  I have dumped Office 2010 a number of times, done the regedit mods, added/removed MS fixes, etc. (long list).  Mark

  • Export the data of a chart to Excel format

    I developed Histogram and Bar diagram in java Graphics2D pkg. I want to export the data of the chart in Excel format so that the file can be opened in Excel tool.

    Is this something that might help....
    <!-- Loop through the range to create a poplist -->
    <%
    java.util.ArrayList alDepartments = new java.util.ArrayList();
    %>
    <select name="DepartmentId">
    <c:forEach var="listEntry" items="${bindings.DepartmentsListView1.rangeSet}">
    <c:set var="thisdept" value="${listEntry.DepartmentId}"/>
    <%
    //<c:out value='${listEntry.DepartmentId}'/>
    String strThisDept = ((Number) pageContext.getAttribute("thisdept")).toString();
    System.out.println( strThisDept );
    alDepartments.add( strThisDept );
    %>
    <c:choose>
    <c:when test="${listEntry.DepartmentId eq bindings['DepartmentId'].attributeValue}">
    <option value="<c:out value='${listEntry.DepartmentId}'/>" selected="true">
    <c:out value="${listEntry.DepartmentName}"/>
    </option>
    </c:when>
    <c:otherwise>
    <option value="<c:out value='${listEntry.DepartmentId}'/>">
    <c:out value="${listEntry.DepartmentName}"/>
    </option>
    </c:otherwise>
    </c:choose>
    </c:forEach>
    <%
    session.setAttribute("sessionalDepartments", alDepartments );
    %>
    </select>

  • Cannot copy and paste in an Excel 2010 file

    Cannot copy and paste in an Excel 2010 file
    The user has modify rights, and on other files it works fine. She can save and do everything with the file except copy and then past to another tab in the same file or a new one. Or anywhere.
    We tried the file with a different user from the same department and there it does work.
    I tried to disable the X-com plugins and disable OVF for performance also. Nothing works...anybody knows maybe what the issue might be ?
    The file is on a network drive on a domain and does work on another user to copy and paste.  I have not let her log in with the same user account n test it on a different system so I asked and will get a update soon. There are no error messages the
    paste option is greyed out.

    Hi,
    How about the issue now, is it solved?
    This issue might be caused by her user profile. What the result would be if using another user account to log on her computer to test this issue.
    Also do you have the same problem when you open excel in Safe Mode?
    Try opening Excel without any Add-ins or hidden workbooks:
    Press and hold the CTRL key, and then click the excel program.
    Best Regards,
    Wind

  • Excel 2010 file opens in Microsfot Office Workbook 97 only on one machine

    We have a shared Excel 2010 file that 4 people use. For the 3 users it opens in Excel 2010 but for the 4th user it opens in Microsoft Office Workbook 97. Why does it not open in Excel 2010 like it does for the rest? How do I get it to open correctly for
    the 4th person?

    Sorry for this qestion. Does this person has Office 2010 installed? If so, clik right button on this file and "choose open with" -> "choose default program", there choose office 2010 and then mark checkbox at the bottom.
     

  • Can I use Bridge to export image data into a .txt file?

    I have a folder of images and I would like to export the File Name, Resolution, Dimensions and Color Mode for each file into one text file. Can I use Bridge to export image data into a .txt file?

    Hello
    You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
    set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
    if f ends with "/" then set f to f's text 1 thru -2
    do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
    use strict;
    use open IN => ':crlf';
    chdir $ARGV[0] or die qq($!);
    local $/ = qq(\\0);
    my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
    local $/ = qq(\\n);
    #     CSV spec
    #     - record separator is CRLF
    #     - field separator is comma
    #     - every field is quoted
    #     - text encoding is UTF-8
    local $\\ = qq(\\015\\012);    # CRLF
    local $, = qq(,);            # COMMA
    # print column header row
    my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
    print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    # print data row per each file
    while (@ff) {
        my $f = shift @ff;    # file path
        if ( ! open(IN, '<', $f) ) {
            warn qq(Failed to open $f: $!);
            next;
        $f =~ s%^.*/%%og;    # file name
        @dd = ('', $f, '', '', '', '');
        while (<IN>) {
            chomp;
            $dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
            ($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
            ($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
            ($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
            ($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
            last unless grep { /^$/ } @dd;
        close IN;
        print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
    EOF
    Hope this may help,
    H

  • How to export a data as an XML file from oracle data base?

    could u pls tell me the step by step procedure for following questions...? how to export a data as an XML file from oracle data base? is it possible? plz tell me itz urgent requirement...
    Thankz in advance
    Bala

    SQL> SELECT * FROM v$version;
    BANNER
    Oracle DATABASE 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS FOR 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    5 rows selected.
    SQL> CREATE OR REPLACE directory utldata AS 'C:\temp';
    Directory created.
    SQL> declare                                                                                                               
      2    doc  DBMS_XMLDOM.DOMDocument;                                                                                       
      3    xdata  XMLTYPE;                                                                                                     
      4                                                                                                                        
      5    CURSOR xmlcur IS                                                                                                    
      6    SELECT xmlelement("Employee",XMLAttributes('http://www.w3.org/2001/XMLSchema' AS "xmlns:xsi",                       
      7                                  'http://www.oracle.com/Employee.xsd' AS "xsi:nonamespaceSchemaLocation")              
      8                              ,xmlelement("EmployeeNumber",e.empno)                                                     
      9                              ,xmlelement("EmployeeName",e.ename)                                                       
    10                              ,xmlelement("Department",xmlelement("DepartmentName",d.dname)                             
    11                                                      ,xmlelement("Location",d.loc)                                     
    12                                         )                                                                              
    13                   )                                                                                                    
    14     FROM   emp e                                                                                                       
    15     ,      dept d                                                                                                      
    16     WHERE  e.DEPTNO=d.DEPTNO;                                                                                          
    17                                                                                                                        
    18  begin                                                                                                                 
    19    OPEN xmlcur;                                                                                                        
    20    FETCH xmlcur INTO xdata;                                                                                            
    21    CLOSE xmlcur;                                                                                                       
    22    doc := DBMS_XMLDOM.NewDOMDocument(xdata);                                                                           
    23    DBMS_XMLDOM.WRITETOFILE(doc, 'UTLDATA/marco.xml');                                                                  
    24  end;                                                                                                                  
    25  /                                                                                                                      
    PL/SQL procedure successfully completed.
    .

  • Export table data in a flat file without using FL

    Hi,
    I am looking for options where I can export table data into a flat file without using FL(File Layout) i.e., by using App Engine only.
    Please share your experience if you did anything as this
    Thanks

    A simple way to export any record (table/view) to an csv fiel, is to create a rowset and loop through all record fields, like below example code
    Local Rowset &RS;
    Local Record &Rec;
    Local File &MYFILE;
    Local string &FileName, &strRecName, &Line, &Seperator, &Value;
    Local number &numRow, &numField;
    &FileName = "c:\temp\test.csv";
    &strRecName = "PSOPRDEFN";
    &Seperator = ";";
    &RS = CreateRowset(@("Record." | &strRecName));
    &RS.Fill();
    &MYFILE = GetFile(&FileName, "W", %FilePath_Absolute);
    If &MYFILE.IsOpen Then
       For &numRow = 1 To &RS.ActiveRowCount
          &Rec = &RS(&numRow).GetRecord(@("RECORD." | &strRecName));
          For &numField = 1 To &Rec.FieldCount
             &Value = String(&Rec.GetField(&numField).Value);
             If &numField = 1 Then
                &Line = &Value;
             Else
                &Line = &Line | &Seperator | &Value;
             End-If;
          End-For;
          &MYFILE.WriteLine(&Line);
       End-For;
    End-If;
    &MYFILE.Close(); You can of course create an application class for generic calling this piece of code.
    Hope it helps.
    Note:
    Do not come complaining to me on performance issues ;)

  • Exporting table data to a CSV file

    hello everyone,
    i need help on exporting table data to a CSV file.
    I have a div element containing the table which displays some data.
    there is a "Export" button just above the table, which if clicked, will export the current data in the table to a .csv file.
    can this be done in jsp? or i need to use servlet?
    also how can i submit the table data only? (as my webpage contiain other data also)
    can anyone provide with some sort of sample code?
    thanks in advance!!

    oops!!
    i just forgot..
    when the user will click on the export button, i want to greet him with a "Save As"
    popup, so that he can specify the filename and location to save the file.
    thanks!!

  • Exporting filterded data from a view to excel

    I have a requirement, where i have to export data from a list to excel after applying some filter to it.
    Say i filter the view by selecting employee dept="Teaching", now i want to export only the filtered rows to excel.
    Is there any way to achieve this.
    Thanks in advance.

    Hi,
    You can create a view with required filters. Then you can export to excel after switching on to filtered view.Refer following link to create filtered view.
    http://office.microsoft.com/en-in/sharepoint-workspace-help/create-view-filters-in-a-lists-tool-design-in-sharepoint-workspace-2010-HA010336352.aspx
    Hope it helps!
    Avni Bhatt

  • SharePoint 2007 Export to Excel 2010 or Excel 2013 Fails to Export All Fields in All Items View

    Hi All,
    When I am trying to export the SharePoint View from SharePoint site to Spreadsheet (Excel 2013), I am able not able to export the the whole data, I'm missing some numerical columns from being displayed in Excel
    I have Infopath form (2007) published on SharePoint Site and I am using MOSS 2007 and Excel 2013. My form has only 20 or so fields and the rest are fields I generated in the form library to do several other calculations. I have already 73 columns
    displayed which should be exported to Excel, need help

    Hi,
    As per your post, I understand “Excel cannot connect to the SharePoint list” is thrown out in Excel 2010 when exporting the external list in SharePoint 2013. We are able to export the external list to Excel 2013.
    This issue does not occur on the standard lists.
    I am able to reproduce the issue and it could be a potential issue in SharePoint 2013.
    We will log this issue to our suggestion box. As after the submission, we may not have any time guarantee when the fix may be released, but it may come out on next cumulative update.
    Appreciate your time and efforts.
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Opening Excel 2010 files from Explorer takes several minutes

    I am running Excel 2010 on Windows 7. For the last year I have had no problems, but today I find that if I try to open any file from Windows Explorer (e.g. by double-clicking it), or from an item pinned to the Task Bar, it takes several minutes to open Excel.
    If I open Excel directly it opens very quickly. I can also open any of the "problem" files in an instant when Excel is open (e.g. from the Recent Files list or from  the File...Open dialog). All of the files in question are on the local hard
    disk.
    I don't have this problem with MS-Word.
    I saw another post here which recommended unchecking the "Ignore
    other applications that use Dynamic Data Exchange (DDE)" option, but I didn't have this option set in the first place.
    Does anyone have any other suggestions for fixing this?

    Double click an excel file, when the excel loading window appears, start Task Manager, terminate the excel process, then re-open the excel file to test if this issue goes away.
    Also someone resolved this issue by installing an add-in. Have a try.
    File->options->Add-ins->Select "Excel Add-Ins" in Manage list box and click button "Go..." ->Tick the add-ins that you want and click button "OK" 
    http://excel2007-slow-open-file.blogspot.in/

Maybe you are looking for