Create table aliases in a query (ADP)
Note The information in this topic applies only to a Microsoft Access project (.adp).
Aliases can make it easier to work with table view, or function names. Using aliases is helpful when:
- You want to make the statement in the SQL pane shorter and easier to read.
- You refer to the table, view, or function name often in your query
— such as in qualifying column names — and want to be sure you stay within a specific character-length limit for your query. - You are working with multiple instances of the same table, view, or function (such as in a self-join) and need a way to refer to one instance or the other.
For example, you can create an alias "e"
for a table name employee_information
, and then refer to the table as "e"
throughout the rest of the query.
- In the Database window, click Queries under Objects, click the query you want to open, and then click Design on the database window toolbar.
- In the Diagram Pane, right-click the table, view, or function for which you want to create an alias, then select Properties from the shortcut menu.
- In the Properties dialog box, enter the alias in the Alias box.
When you create a table alias, the Query Designer substitutes the alias for the corresponding table name in the Table column of the Grid pane.
Note The SQL standard specifies that when you create an alias for a table name, you must use the alias to refer to the table in the rest of the SQL statement (that is, you cannot use the original table name).