Results 1 to 3 of 3

Thread: Openrowset

  1. #1
    Join Date
    Nov 2008
    Posts
    42

    Unanswered: Openrowset

    Good Morning!

    I am using SQL 2000 and I have a query that uses openrowset to export SQL data to some excel spreadsheets. I understand that DTS could be an alternative solution, but I was curious about the openrowset first.

    When I run the query below, the numbers are imported as text and it takes excel a long time to convert all the text to numbers (several thousand rows on dozens of sheets). Is there a way to export the numbers into excel with a number format using openrowset?

    Thanks
    Drew


    Code:
    insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 
    'Excel 8.0;Database=D:\trending_tool\lms_template.xls;', 
    'SELECT * FROM [del_lms$]') 
    SELECT 
    netdatetime,
    site,
    calltype,
    sum(nca) as NCA,
    sum(nco) as NCO,
    sum(NCH) as NCH, 
    sum(c0020) as C0020,
    sum(SA) as SA,
    sum(ut) as UT,
    sum(req_all) as req_all,
    sum(req_wo_unprod) as req_wo_unprod,
    sum(sch_all) as sch_all,
    sum(sch_wo_unprod) as Sch_wo_unprod,
    sum(planned) as planned, 
    sum(act_fte) as ACT_FTE
    from ccmcp.afaulk.cap_levers_data 
    group by netdatetime, site, calltype

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    look up format files in books online, they should be able to help you
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2008
    Posts
    42
    Quote Originally Posted by gvee
    look up format files in books online, they should be able to help you

    Thank you very much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •