$ sign in SQL clause in MS Query

F

FredAker

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.csv 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!
 
N

Nayab

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.csv 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top