column alias in access query
Solution 1
This question is tagged ms-access, and in Access it is easy to discover what is allowed in queries by using the query design window. For more elegant and advanced queries the window is not suitable, but for this it is a useful tool.
SELECT Table1.AText AS [First Name]
FROM Table1;
Solution 2
no, Typically, column names should never have embedded spaces within them. Some people do, but not recommended. For the SQL engines to recognize such columns, they explicitly need the tic marks around the column to understand that its not two words, but one column name. Even though the the column name without the space could come back as FirstName, whatever your output, you can format reports and such however else you want.
Jon Egerton
Updated on June 27, 2022Comments
-
Jon Egerton almost 2 years
I am using a query in vb.net, database is Access I need alias of query like sql but the query return me column alias and also ' '
SELECT COLUMN1 AS 'FIRST NAME'
I expect the result to be a field called
FIRST NAME
but it returns the string "FIRST NAME"Is there is any way if return me the field
FIRST NAME
instead of "FIRST NAME"-
Error No.2793985 over 10 yearspossible duplicate of How can I use the table name in a column alias in Access SQL?
-