By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,816 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,816 IT Pros & Developers. It's quick & easy.

How do I keep colon in column header in an Access query?

P: 1
Doing a query in MS Access. I need to keep a colon in a field header. I can keep the colon by using quotes, but it returns quotes with the header, which I don't want. Help!!

Here is my query:
"ETHNICITY: NOT HISP/LAT": IIf([Hispan_Lat_TF]=1,"N","Y")

Returns this: "ETHNICITY: NOT HISP/LAT:"

I want this: ETHNICITY: NOT HISP/LAT
1 Week Ago #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,470
Interesting question. It turns out that there isn't a simple way to do this as Access (Not Jet or ACE.) won't allow you to enter the square brackets in the QBE grid.

However, it can be done from the SQL View. If you switch to that then you can add the following to your SELECT statement :
Expand|Select|Wrap|Line Numbers
  1. , IIf([Hispan_Lat_TF]=1,'N','Y') AS [ETHNICITY: NOT HISP/LAT]
This then shows up in the QBE (Design View) of the Query just as :
Expand|Select|Wrap|Line Numbers
  1. ETHNICITY: NOT HISP/LAT: IIf([Hispan_Lat_TF]=1,'N','Y')
Perfectly invalid if you were to enter it there, yet works as required.

Do be aware that any time you wish to edit that Field in the Query it will require you to use the SQL View again.
1 Week Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.