ms-access by sangeetha parthasarathy topics to be covered §comparing values in selection criteria...
TRANSCRIPT
Topics to be coveredComparing Values in Selection CriteriaCalculating Values in a QueryChanging the appearance of ValuesCreating a Query to Add RecordsCreating a Query to Create a New TableCreate a Query to Delete RecordsCreate a Query to Update RecordsSpeeding up Searches with IndexesCreating Multiple Field Indexing
Insert a Comparison Expression
Display the query in Design View
Position the insertion point in the Criteria box for which you want to include an expression
Click the Build button on the Query Design toolbar
Click the appropriate comparison operator button. Choose the appropriate operator.
Enter a value or click a field whose value you want to compare
Click OK
Insert a Logical ExpressionDisplay the query in Design viewPosition the insertion point in the Criteria box
for which you want to include in the expressionClick the Build button on the Query Design
toolbar.Click one of the logical operator buttons.To see
additional logical operators click on the Operators folder and choose an operator you want from the list.
Enter a value or click a field whose value you want to use in the expression.
Click OK
Create a Calculated FieldDisplay the query in Design view Position the insertion point in the Field row for
a blank column in the design grid Click the Build button on the Query Design
toolbar to display the Expression Builder dialog box
Double-click the field(or fields) you want to use in the calculation
Click the button corresponding to the calculation you want or click the operator folder and click the Arithmetic folder to use the operator you want.
Type any other values(constants)you want to use in the expression
Click OK.
Change a Number FormatPosition the insertion point in the
number field whose format you want to change, and then click the Properties button on the Query Design toolbar
Click the Format drop-down arrow, and then select the format you want to use
Click the Decimal Places box, and then select one of the available decimal places from the drop-down list, or enter the number of decimal places you want.
Click the Close button
Create a Query to Add Records
Create a simple query based on the table whose records you want to append to another table
In Design view,click the Query Type drop-down arrow on the Query Design toolbar, and then click Append Query
Type the name of the table to which you want to append records; or click the drop-down arrow and choose a table from the list
Click Current Database if the table is in the currently open database or Click Another Database name.
Click OKDrag the fields you want to
append from the fieldlist to the Query design grid. If you want to append all the fields you can drag the (*) to the Query design grid
If the Primary key is not an AutoNumber data type, drag the primary key field from the table to the design grid
Drag from the field list any fields you want to use in selection criteria
To preview the records that will be added,click the View button on the Query Design toolbar. To return to Design view,click the View button on the Table Datasheet toolbar
Click the Run button on the Query Design Toolbar to append the records
Click Yes to confirm that you want to append records
Create a Query to Create a New TableCreate a Query based on the tables or
queries that contain records you want to put in the table
In Design view click the Query Type button drop-down arrow and select Make-Table Query
Type the name of the table you want to create; or Click the drop-down arrow and choose a table from the list
Click Current Database if the table is in currently open database, or click Another Database.
Click OK
Click OKDrag the Fields you want to be
added in the new table from the query design grid
Specify the criteria for the fieldsTo preview the records that will
appear in the new table,click the view button on the Query Design toolbar
Click the Run button on the Query Design toolbar to make the new table
Click Yes to confirm that you want to create the new table
Create a Query to Delete RecordsCreate a new query based on the table
that contains records you want to deleteIn Design view,Click the Query Type
button drop-down on the Query Design toolbar , and then Click Delete Query
For the Table from which you want to delete records,drag the (*) fro the field list to the fields query design grid
Drag one or more fields from the table list and enter the selection criteria in the box for each field
To preview the records that will be deleted , click the View button on the Query Design toolbar
Click the Run button on the Query Design toolbar to delete the records
Click Yes to confirm that you want to delete the records
Create a Query to Update RecordsCreate a query based on the tables or
queries that include records that you want to update and the fields you want to use for the selection criteria
In the design view, click the Query Type button drop-down arrow on the Query Design toolbar, and then click Update Query
Drag the fields you want to update for which you want to specify criteria from the field list to the query design grid
Specify the criteria for the fieldsIn the Update To Box for the
fields you want to update, type the expression or value you want to use to change the fields
To preview the records that will be updated, click the view button on the Query Design toolbar
Click the Run button on the Query Design toolbar to update the records
Click Yes to confirm that you want to update the records
View or Edit Indexes
Open the Table in Design viewClick the Index button on the Table
Design toolbarChange indexes or index propertiesClick the Indexes button when you
have finished viewing or editing the indexes and index properties.
Create a Multiple-Field IndexOpen the table in Design viewClick the Indexes button on the Table
Design toolbarIn the Indexes window, click in the first
blank row in the Index Name column and type the name you want for your index
Click the right side of the first blank row in the Field Name Column and select a field to include in this index