Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Syntax error?

Status
Not open for further replies.

PedroDC

Technical User
Feb 28, 2007
3
PT
Greetings!

Recently I started using VBA to programm Microsoft Query, with help of Macro Recorder (wich seems to make somewhat of a mess).

Relative to the code below I get Syntax Error and can't understand why:


.CommandText = Array( _
"SELECT Groups.`Group Name`, `Flown Revenue 2005`.`Agent Code`, Sum(`Flown Revenue 2005`.Coupons) as [Cpns]" & Chr(13) & "" & Chr(10) & "FROM {oj `C:\My Documents\Temporário\Unify\db2006 November-onward Compact`.`Flown Revenue 20" _
, _
"05` `Flown Revenue 2005` LEFT OUTER JOIN `C:\My Documents\Temporário\Unify\db2006 November-onward Compact`.Groups Groups ON `Flown Revenue 2005`.`Agent Code` = Groups.`Agent Code`}" & Chr(13) & "" & Chr(10) & "WHERE Groups.`Group Name`" & " = " & cmdComboBox.Text &" Chr(13) & "" & Chr(10) & "GROUP BY Groups.`G" _
, "roup Name`, `Flown Revenue 2005`.`Agent Code`")


Please advise
Thanks!
 
you are more likely to get an answer in the appropriate forum, because this isn't it

the backticks suggest mysql (forum436)

when you do find the right forum, you will also want to post the error message

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top