View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default SQL statement in VBA

Have you tried recording a macro using Get external data. You can then look
at the SQL portion and get some hints. I think the answer is to use single
quotes, but don't do that much with SQL.

--
Regards,
Tom Ogilvy

"Michael Malinsky" wrote in message
ups.com...
Hello all,

I know how to create an SQL statement in VBA, but the problem that I'm
running into with this one particular database (not of my design) is
that the tables and queries have names that contain spaces (i.e.,
Customer List). Apparently the SQL statement doesn't like the space in
the table/query name. I've tried a couple of different things without
success. Can anyone help with with this problem?

Thanks,
Mike.