using # in a field name in an access query

  • Thread starter Thread starter Guest
  • Start date Start date
Enclose the name in square brackets:
[Library #]

In the long run, you will find it easier to avoid strange characters and
spaces in field names.
 
It won't let me save the query when I do this.

Trust me it's not my choice to use it this syntax, my boss willingly told a
third party vendor we could provide them a text file exported from access
with field names and they want that to be the name.

Allen Browne said:
Enclose the name in square brackets:
[Library #]

In the long run, you will find it easier to avoid strange characters and
spaces in field names.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

omegagmike said:
How do I use the # sign as a field name in a select query, ex "Library #:
column"?
 
Works fine here.

Go into Northwind (sample database), and paste this into SQL view in a new
query:


SELECT Customers.CustomerID, Customers.CompanyName, Customers.Address AS
[Library #] FROM Customers;

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

omegagmike said:
It won't let me save the query when I do this.

Trust me it's not my choice to use it this syntax, my boss willingly told
a
third party vendor we could provide them a text file exported from access
with field names and they want that to be the name.

Allen Browne said:
Enclose the name in square brackets:
[Library #]

In the long run, you will find it easier to avoid strange characters and
spaces in field names.


omegagmike said:
How do I use the # sign as a field name in a select query, ex "Library
#:
column"?
 
I get the query to put the right field name on when I run it, but when I
export it and put the column names on the text file, it comes up as "Library
.."

Allen Browne said:
Works fine here.

Go into Northwind (sample database), and paste this into SQL view in a new
query:


SELECT Customers.CustomerID, Customers.CompanyName, Customers.Address AS
[Library #] FROM Customers;

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

omegagmike said:
It won't let me save the query when I do this.

Trust me it's not my choice to use it this syntax, my boss willingly told
a
third party vendor we could provide them a text file exported from access
with field names and they want that to be the name.

Allen Browne said:
Enclose the name in square brackets:
[Library #]

In the long run, you will find it easier to avoid strange characters and
spaces in field names.


How do I use the # sign as a field name in a select query, ex "Library
#:
column"?
 
Yes, I see that also in the export.

If it's worth the trouble, you could Open the file after export, Input Line,
edit it, and re-write the file.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

omegagmike said:
I get the query to put the right field name on when I run it, but when I
export it and put the column names on the text file, it comes up as
"Library
."

Allen Browne said:
Works fine here.

Go into Northwind (sample database), and paste this into SQL view in a
new
query:


SELECT Customers.CustomerID, Customers.CompanyName, Customers.Address AS
[Library #] FROM Customers;


omegagmike said:
It won't let me save the query when I do this.

Trust me it's not my choice to use it this syntax, my boss willingly
told
a
third party vendor we could provide them a text file exported from
access
with field names and they want that to be the name.

:

Enclose the name in square brackets:
[Library #]

In the long run, you will find it easier to avoid strange characters
and
spaces in field names.


How do I use the # sign as a field name in a select query, ex
"Library
#:
column"?
 
Strange I tried it out, exported it as an excel and rft file and see
Library# ??

Herman
Allen Browne said:
Yes, I see that also in the export.

If it's worth the trouble, you could Open the file after export, Input Line,
edit it, and re-write the file.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

omegagmike said:
I get the query to put the right field name on when I run it, but when I
export it and put the column names on the text file, it comes up as
"Library
."

Allen Browne said:
Works fine here.

Go into Northwind (sample database), and paste this into SQL view in a
new
query:


SELECT Customers.CustomerID, Customers.CompanyName, Customers.Address AS
[Library #] FROM Customers;


It won't let me save the query when I do this.

Trust me it's not my choice to use it this syntax, my boss willingly
told
a
third party vendor we could provide them a text file exported from
access
with field names and they want that to be the name.

:

Enclose the name in square brackets:
[Library #]

In the long run, you will find it easier to avoid strange characters
and
spaces in field names.


How do I use the # sign as a field name in a select query, ex
"Library
#:
column"?
 
Back
Top