MS Access

Query Data And Query Criterion

Query Data And Query Criterion

When you want to review the most current data, or you want to summarize the previous data, or you have some specific such role. The first thing that would come to your mind is writing a query statement.  

Queries are of several types. We will discuss each type of query one by one in great detail. 

• SELECT QUERY 

If your information base has a table with a great deal of data about items and  you need to audit a rundown of items and their costs, here’s how you’d make  a select inquiry to restore only the item names and the individual cost: 

Open the information base and on the Create tab, click Query Design.  

Double-tap the Products table and close the exchange box in the Show Table box on the Tables tab.  

In the Products table, suppose that you have the Product Name and List Price fields. Double-tap the Product Name and List Price to add these fields to the grid. 

On the Design tab, click Run. The inquiry runs and shows a rundown of items and their costs. 

• PARAMETER QUERY 

Open the database and on the Create tab, click Query Design.  

Double-tap the Products table and close the exchange box in the Show Table box on the Tables tab.  

In the Products table, suppose that you have the Product Name and List Price fields. Double-tap the Product Name and List Price to add these fields to the grid. On the Design tab, click Run. The inquiry runs and shows a rundown of items and their costs. 

You can likewise determine what kind of data a parameter ought to acknowledge. You can set the information type for any boundary. However, it is particularly imperative to set the information type for numeric, cash, or date/time information. At the point when you indicate 

the information type that a boundary ought to acknowledge, clients see error messages in the event that they have entered some unacceptable kind of information.  

Also, you can make use of this feature in a more efficient way. Let me teach you how. Make estimations dependent on your information.  

You ordinarily would not utilize tables to store determined qualities, similar to subtotals, regardless of whether they depend on information in a similar data set, in light of the fact that determined values can get obsolete if the qualities that they depend on change. For instance, you would not store somebody’s age on a table, in light of the fact that consistently you would need to refresh the value; all things considered, you store the individual’s date of birth and afterward utilize a question to figure the individual’s age.  

For instance, if you have an information base for certain items you’d prefer to sell. This data set has an Orders Details table that has data about the items in the fields. For example, You can calculate the subtotal by using a query that multiplies the quantity of each product by the unit price for that product, multiplies the quantity of each product by the unit price and discount for that product, and then subtracts the total discount from the total unit price. 

So now, since we have learned a few concepts about the query, let us analyze the basic query criterion.  

So what is a query criterion? 

These are the basic rules through which queries are guided. It’s like the TCP/IP of Queries. 

A criterion that you specify for a Hyperlink field is, by default, applied to the display text portion of the field value. To specify criteria for the destination Uniform Resource Locator (URL) portion of the value, use the HyperlinkPart expression. The syntax for this expression is as follows: HyperlinkPart([Table1].[Field1],1) =  

“http://www.microsoft.com/”, where Table1 is the name of the table containing the hyperlink field, Field1 is the hyperlink field, and http://www.microsoft.com is the URL you want to match. 

Features

  1. It is easy to understand, as well as for use  
  2. Sending and receiving files or applications 
  3. Provides information for individual and smaller teams  
  4. Allows creating forms, and tables for storing information

Advantages

  1. Quick and easy to form  
  2. It produces pliability and invincible data 
  3. It helps to manage and organize the specified data  
  4. Easy to search and get a database

Limitations

  1. Not suitable for the web  
  2. Security and data probity  
  3. It is not obtainable over the internet 

Uses

  1. Used for official work, i.e., in schools or offices  
  2. It is also used for business purposes 
  3. Used for programming evolution  

Basic terms

• Database file – It is a file that stores the entire database and is saved to storage devices such as RDBMS.  

• Data types – Data types are the elements or components of each field. Each field consists of only one data type like text, number, data, etc. Such as tables, queries, forms, reports, and modules.