ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   $ sign in SQL clause in MS Query (https://www.excelbanter.com/excel-discussion-misc-queries/196846-%24-sign-sql-clause-ms-query.html)

FredAker

$ sign in SQL clause in MS Query
 
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!


Nayab

$ 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


All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com