The following has no problem gathering records and inserting into a new table.
Dim query As String
query = "SELECT DISTINCTROW Unitholders.[Unitholder ID], Unitholders.[Do Not Mail], Unitholders.FirstName, Unitholders.LastName, Unitholders.[E-mail], Unitholders.[E-mail2], Accounts.[Account Name], Accounts.[Account Type], Accounts.Institution, Accounts.[Inst Account #], Sum(Transactions.Cost), Sum(Transactions.Quantity) AS [Sum Of Quantity], Transactions.Class INTO xEmail" & _
" FROM Unitholders INNER JOIN (Accounts INNER JOIN Transactions ON Accounts.[TC Acct ID] = Transactions.[TC Account ID]) ON Unitholders.[Unitholder ID] = Accounts.Unitholder" & _
" GROUP BY Unitholders.[Unitholder ID], Unitholders.[Do Not Mail], Unitholders.FirstName, Unitholders.LastName, Unitholders.[E-mail], Unitholders.[E-mail2], Accounts.[Account Name], Accounts.[Account Type], Accounts.Institution, Accounts.[Inst Account #], Transactions.Class;"
However, when I add Accounts.[TC Acct ID] to the SELECT row as well as the GROUP BY row, no records are inserted. No errors seem to appear either.
Could it be too long of a string?
Thx.
Dim query As String
query = "SELECT DISTINCTROW Unitholders.[Unitholder ID], Unitholders.[Do Not Mail], Unitholders.FirstName, Unitholders.LastName, Unitholders.[E-mail], Unitholders.[E-mail2], Accounts.[Account Name], Accounts.[Account Type], Accounts.Institution, Accounts.[Inst Account #], Sum(Transactions.Cost), Sum(Transactions.Quantity) AS [Sum Of Quantity], Transactions.Class INTO xEmail" & _
" FROM Unitholders INNER JOIN (Accounts INNER JOIN Transactions ON Accounts.[TC Acct ID] = Transactions.[TC Account ID]) ON Unitholders.[Unitholder ID] = Accounts.Unitholder" & _
" GROUP BY Unitholders.[Unitholder ID], Unitholders.[Do Not Mail], Unitholders.FirstName, Unitholders.LastName, Unitholders.[E-mail], Unitholders.[E-mail2], Accounts.[Account Name], Accounts.[Account Type], Accounts.Institution, Accounts.[Inst Account #], Transactions.Class;"
However, when I add Accounts.[TC Acct ID] to the SELECT row as well as the GROUP BY row, no records are inserted. No errors seem to appear either.
Could it be too long of a string?
Thx.