Space in Fieldname of a Query

J

Jeefgeorge

I have a query that is returning the correct results however, one of the
field names is not as expected.

I type "Qty (Est): Quanity" in the Field row of design view.
If I switch to datasheet view, the field name reads as "Qty (Est)"
However if I close the query and re-open it, the field name reads
"QTY(Est)".....no space.
This poses a problem when the query is transfered to excel, where the Wrap
Text Property is enabled for all cells...this field name then reads
QTY(
Est)

the space is needed since I would like it to read
QTY
(Est)

Any help is appreciated....I'm very frustrated with this one
 
B

Bill Mosca

Try this (but I haven't tested it). Open your query and fix the space. Then
click on the SQL view. You should see the syntax for the query. Put square
brackets around your alias.

SELECT Quanity As [Qty (Est)]
FROM MyTable

Then save the query immediately.
 
J

Jeefgeorge

The brackets were already there in SQL view. I have a work around....if I
use 2 spaces between Qty and (Est) it keeps them both. I still don't
understand why a single space is removed.

Bill Mosca said:
Try this (but I haven't tested it). Open your query and fix the space. Then
click on the SQL view. You should see the syntax for the query. Put square
brackets around your alias.

SELECT Quanity As [Qty (Est)]
FROM MyTable

Then save the query immediately.

--
Bill Mosca, MS Access MVP
http://www.thatlldoit.com
http://mvp.support.microsoft.com/profile/Bill.Mosca
http://tech.groups.yahoo.com/group/MS_Access_Professionals




Jeefgeorge said:
I have a query that is returning the correct results however, one of the
field names is not as expected.

I type "Qty (Est): Quanity" in the Field row of design view.
If I switch to datasheet view, the field name reads as "Qty (Est)"
However if I close the query and re-open it, the field name reads
"QTY(Est)".....no space.
This poses a problem when the query is transfered to excel, where the Wrap
Text Property is enabled for all cells...this field name then reads
QTY(
Est)

the space is needed since I would like it to read
QTY
(Est)

Any help is appreciated....I'm very frustrated with this one
 
B

Bill Mosca

I don't know why either. Do you have AutoCorrect turned on?

--
Bill Mosca, MS Access MVP
http://www.thatlldoit.com
http://mvp.support.microsoft.com/profile/Bill.Mosca
http://tech.groups.yahoo.com/group/MS_Access_Professionals




Jeefgeorge said:
The brackets were already there in SQL view. I have a work around....if I
use 2 spaces between Qty and (Est) it keeps them both. I still don't
understand why a single space is removed.

Bill Mosca said:
Try this (but I haven't tested it). Open your query and fix the space.
Then
click on the SQL view. You should see the syntax for the query. Put
square
brackets around your alias.

SELECT Quanity As [Qty (Est)]
FROM MyTable

Then save the query immediately.

--
Bill Mosca, MS Access MVP
http://www.thatlldoit.com
http://mvp.support.microsoft.com/profile/Bill.Mosca
http://tech.groups.yahoo.com/group/MS_Access_Professionals




Jeefgeorge said:
I have a query that is returning the correct results however, one of the
field names is not as expected.

I type "Qty (Est): Quanity" in the Field row of design view.
If I switch to datasheet view, the field name reads as "Qty (Est)"
However if I close the query and re-open it, the field name reads
"QTY(Est)".....no space.
This poses a problem when the query is transfered to excel, where the
Wrap
Text Property is enabled for all cells...this field name then reads
QTY(
Est)

the space is needed since I would like it to read
QTY
(Est)

Any help is appreciated....I'm very frustrated with this one
 

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