+ Reply to Thread
Results 1 to 2 of 2

When I CopyFromRecordset a MYSQL CONCAT statement, it puts 256 blank rows into Excel table

  1. #1
    Registered User
    Join Date
    11-11-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    2

    Question When I CopyFromRecordset a MYSQL CONCAT statement, it puts 256 blank rows into Excel table

    When I run an Excel Module which contains SQL, the data going into the first Excel table is populated with 114,532 rows.
    But the second Excel Table (which has a concat as part of the SQL) is populated with 256 blank rows. However, when I run the second SQL query straight in the db, it returns all 114,532 fully populated rows of data as a concat - why is Excel producing 256 blank rows when there are actually values?


    The Forum wouldn't let me post the SQL in here - so please see attachment.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    11-11-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    2

    Re: When I CopyFromRecordset a MYSQL CONCAT statement, it puts 256 blank rows into Excel t

    Never mind - solved! For some reason I had to cast the concat statement in order for the results to pull through.
    It would be nice to know ifanyone knows why I had to do this?
    SELECT CAST(CONCAT('INSERT INTO db1.Data1 (DataID,DataID2,DataDate) VALUES(',
    DataID,',',DataID2,',','''',DataDate,''');') AS CHAR) AS `Data Results`
    FROM db2.Data2;

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 01-29-2014, 12:57 AM
  2. Replies: 5
    Last Post: 07-03-2013, 12:02 PM
  3. Pivot table, Automatically puts data in alphabetical
    By Cicada in forum Excel General
    Replies: 6
    Last Post: 09-01-2011, 10:30 AM
  4. CopyFromRecordset incorrect mysql/myODBC 5.1 (excel 2007)
    By ZTHawk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-16-2011, 03:12 AM
  5. Excel to MySQL table
    By mjhaston in forum Excel General
    Replies: 5
    Last Post: 07-25-2011, 09:59 AM
  6. CopyFromRecordset Method to Excel sheet producing duplicate rows?
    By Enee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2009, 12:49 PM
  7. Re: Concat values in two or more rows based on id and eliminateduplicates
    By Dave Peterson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2005, 02:05 PM
  8. [SOLVED] Re: Concat values in two or more rows based on id and eliminate duplicates
    By Tom Ogilvy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2005, 02:05 PM

Tags for this Thread

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