You forgot some spaces. This
Code:
SQL_Run = "SELECT VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, Sum(ST) AS [Sum of Onrents], ServiceLine, Case, Company" & _
"FROM Onrent" & _
"GROUP BY VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, ServiceLine, Case, Company;"
evaluates to:
Code:
SELECT VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, Sum(ST) AS [Sum of Onrents], ServiceLine, Case, CompanyFROM OnrentGROUP BY VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, ServiceLine, Case, Company;
Try this:
Code:
SQL_Run = "SELECT VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, Sum(ST) AS [Sum of Onrents], ServiceLine, Case, Company" & _
" FROM Onrent" & _
" GROUP BY VT, x_HSBEZ, x_NSBEZ, SippGroup, LT_ST, ServiceLine, Case, Company;"
<edit>
Yes! As Welsh mentions always Debug.print your strings during development when you build them this way so you can double check that they are put together the way you wanted them to be.