+ Reply to Thread
Results 1 to 6 of 6

Export from SQL Table to Worksheet Tabs

  1. #1
    Forum Contributor
    Join Date
    10-04-2007
    Posts
    118

    Export from SQL Table to Worksheet Tabs

    Just wondering if this is possible,

    I have a table in SQl that I want to export into Excel, which is pretty straight forward. Instead of transporting to a single worksheet tab in Excel, I want the data to be split based on a specific column into different worksheet tabs

    For Example,

    SELECT * FROM MyTable

    Student Course Amount
    2549 Art 100
    3254 Science 300
    3285 Art 234
    2317 Art 674

    So when I’ve exported the data to Excel, There should be 2 tabs labelled Art, Science, with the appropriate data in them

    Can this be done?

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Export from SQL Table to Worksheet Tabs

    The simplest way would be to use Excel's external data feature and set up an extract on each sheet returning the values you want. Which version of Excel are you using?
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Contributor
    Join Date
    10-04-2007
    Posts
    118

    Re: Export from SQL Table to Worksheet Tabs

    i'm using Excel 2002

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Export from SQL Table to Worksheet Tabs

    It's on the Data menu then - something like Data-Import external data-new database query, then just step through the wizard (it's fairly self-explanatory, I think) to connect to your database and get the fields you want, and apply the relevant filter for each sheet.

  5. #5
    Forum Contributor
    Join Date
    10-04-2007
    Posts
    118

    Re: Export from SQL Table to Worksheet Tabs

    i've followed your instructions and it export the data from SQL table to Excel, but how to i export to individual worksheet tabs based on the a specific column?

    thanks

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,984

    Re: Export from SQL Table to Worksheet Tabs

    As I mentioned, do one query for each sheet and set the relevant filter when returning the data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1