How To Create A Request With A Parameter

Table of contents:

How To Create A Request With A Parameter
How To Create A Request With A Parameter

Video: How To Create A Request With A Parameter

Video: How To Create A Request With A Parameter
Video: Part 8 - Query parameters in express HTTP request 2024, December
Anonim

A query is a specially designed database management tool that allows you to select the necessary information according to specified criteria. Moreover, the query result will always be relevant, since only its structure and selection condition are preserved.

How to create a request with a parameter
How to create a request with a parameter

Necessary

  • - a computer with the Microsoft Office software package installed;
  • - skills in working with Microsoft Access.

Instructions

Step 1

Start Microsoft Access to create a parametric query. This query is created on the basis of any field of the table, for which the user further enters a specific value.

Step 2

Go to the database window, to the "Queries" tab. To create a parametric query, click the New button and select In Design Mode. A query form and a window for selecting tables and fields will appear on the screen. Select the fields from the tables that you want to add to the query. For example, you have a Clients table and you want to create a query to find a client by the director's last name. To do this, select the table "Clients", double-click on the field "Client code", "Company name", "Director's surname". Close the field selection window. Go to the Director's Last Name field on the request form. In order to create a parametric query, in the "Criteria" field, enter the following: [Enter the last name of the client]. It is this text that will be displayed to the user when he starts this request, so try to make it as clear as possible.

Step 3

Create a query with several parameters, for this, make a new query in the Designer, select the required fields from the tables. want to add. For example, select the table "Customers", from it the field "Company name", then select the table "Orders" and from it select the field "Order date" and "Order amount". Close the table selection windows, go to the "Order date" field. In the selection condition, enter the following:

Between [enter start date] and [enter end date]

When executing such a request, the user will be prompted to enter the dates between which the order should be searched.

Step 4

Make a parametric query using the LIKE operator and the * character. Create a query in design mode, select the "Products" table, in the "Product brand" field, enter the expression in the selection condition

LIKE "*" & [Enter products containing the expression] & "*"

When you run a query for execution, enter the word "sauce" in the query field, the query will give you all the products where this word is mentioned, for example, "tomato sauce", "soy sauce".

Recommended: