View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Nayab Nayab is offline
external usenet poster
 
Posts: 62
Default $ sign in SQL clause in MS Query

On Jul 30, 1:23*pm, FredAker
wrote:
I use MS Query with data in text files. Now the text file has been moved to a
new location where the path name includes a "$" sign. This is not accepted by
MS Query. My SQL looks like this:

SELECT Airports.Currency, Airports.Market
FROM `\\aaa.xyz.qwe.int\groups$\Shared\Data`\Airports.c sv Airports

It works fine if I map the drive with
* net use N: \\stoeai00.emea.kuoni.int\groups$
and change the SQL to
SELECT Airports.Currency, Airports.Market
FROM `N:\Shared\Data`\Airports.csv Airports

But I cannot do the drive mapping for all my users.

I would really appreciate help!


you need to escape the $. In MS SQL single quote is the escape
character . so you may change your query to :

SELECT Airports.Currency, Airports.Market
FROM "\\aaa.xyz.qwe.int\groups'$\Shared\Data"\Airports. csv Airports