Aracılığıyla paylaş


How to: Add Columns to Queries

To use a column in a query, you must add it to the query. You might add a column to display it in query output, to use it for sorting, to search the contents of the column, or to summarize its contents. You can decide which of the columns you use in the query are included in the results pane when the query is run. For more information see How to: Remove Columns from Query Results.

Not

For Microsoft SQL Server databases, you can see the data type of a column in Query and View Designer; select the table or table-valued object in the Diagram Pane and in the properties window click Column List. Then click the ellipses (…) to open the Column List dialog box.

Wherever you use a column in a query, you can also use an expression that can consist of any combination of columns, literals, operators, and functions. For more information, see Expressions in Queries.

Not

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Working with Settings.

To add an individual column

  • In the Diagram Pane, select the check box next to the column that you want to include.

    -or-

  • In the Criteria Pane, move to the first blank grid row, click the field in the Column column, and select a column name from the drop-down list.

To add all columns for one table or table-valued object

  • In the Diagram Pane, select the check box next to *(All Columns).

To add all columns for all tables and table-structured objects

  1. Make sure no join lines in the Table Operations Pane are selected.

  2. Right-click in the empty space of the Design window and choose Properties from the shortcut menu.

  3. In the Properties window click Output all columns and choose Yes or No from the dropdown list.

See Also

Tasks

How to: Remove Columns from Query Results

How to: Remove Columns from Queries

Other Resources

Specifying Search Criteria

Summarizing Query Results

Performing Basic Operations with Queries