MS Query Alias

Dugantrain

Active Member
Joined
Feb 10, 2003
Messages
354
Hi, I'm trying to do something which seems really easy, but I'm just not getting it. I have Excel pulling from an external data source (ProTrack, for what it's worth) and I need to add a field which is not in the data source called "Status". This field will simply have the word "Open" in every single field. In the Access SQL that I'm used to, this is simple:
Code:
'Open' AS STATUS
But that doesn't work for MS Query. In fact, I've tried every possible combination of single quotes, double quotes, and parentheses, and it still won't alias this stupid field!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I've tried that, but it's still not getting it. In fact, this is my SQL:
Code:
SELECT NEWCALL.SERIAL, NEWCALL.CUST_PROB, NEWCALL.CADPN, NEWCALL.C_STREET, NEWCALL.C_CITY, NEWCALL.C_STATE, NEWCALL.C_ZIP, NEWCALL.NSS_AREA, NEWCALL.C_CONTACT, NEWCALL.PHONE, NEWCALL.RC_DATE, NEWCALL.COMMENTS, NEWCALL.TARGET_ACTUAL_DATE, NEWCALL.TARGET_ACTUAL_TIME, NEWCALL.BO_UPDATE, NEWCALL.TERR_UPDATE, NEWCALL.CLOSED_DATE, NEWCALL.CLOSED_TIME, 'OPEN' AS 'STATUS' 
FROM BRIO.NEWCALL NEWCALL
But it's no good?!
 
Upvote 0
Using the MS Query GUI what happens when you type 'Open' in the new column field. Once the 'Open' column button is created double-click it and enter STATUS in the "Column heading" field of the Edit Column dialog?
 
Upvote 0
Well,
Code:
'OPEN' AS """STATUS"""
will make the column heading show up as
Code:
"STATUS"
with double quotes around the word. I try to use less quotes, but it always errors. I can't believe how difficult this is!
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top