MS-Access: IF-then-else statement
What is Microsoft Access?
Microsoft Access is a member of the Microsoft 365 family of applications, and is a powerful productivity tool made for business and enterprise users.
How Microsoft Access is used
-Tables: Access stores its data in tables. You can build a single database that includes all the data for the entire project — this is often called a "flat" database.
-Relational databases: It's almost always easier, though, to create many tables, each containing elements of the data that needs to be tracked for a project (for example, a business might maintain separate tables for product data, orders, clients, and shipping information). Each of the tables can be interrelated and connected to one another — this is called a relational database, which allows developers to create many relatively simple databases and relate them to each other.
Queries: Queries are another common element in Access databases. The program supports sophisticated queries to find information in the database, which can be important when the database may contain thousands of entries.
-Forms: Database developers often create forms that allow users to enter information into the database without using a spreadsheet. By avoiding the need to enter data in a spreadsheet-like table, there's much less chance for data entry error.
Reports: Access allows users to create custom reports quickly and easily. A Report Wizard makes it easy to sort, group, and label data for easy printing and sharing.
IIF Functions
An IIF function evaluates a specified condition and returns one value if the condition is true, and another if the condition is false. For example, you could use the IIF function in an invoice to create a formula that would discount.
The IIF function contains three parts, or arguments:
A logical test, which is a value or formula that can be evaluated as true or false.
The value that is returned if the logical test is true.
The value that is returned if the logical test is false.
Comparison Operators
Comparison Operators | Description |
---|---|
< | Returns True if the first value is less than the second value. |
<= | Returns True if the first value is less than or equal to the second value. > Returns True if the first value is greater than the second value. |
>= | Returns True if the first value is greater than or equal to the second value. |
= | Returns True if the first value is equal to the second value. |
<> | Returns True if the first value is not equal to the second value. It is also referred to as NOT as this article uses <>False |
Special Criteria related operators
Special Operators | Description |
---|---|
Is Null or Is Not Null | Determines whether a value is Null or Not Null, where Null is empty. Note that a space in a field is not empty despite not being visible. |
Like “pattern” | Matches string/text values by using the wildcard operators such as? for an unknown single character or * for any number of unknown characters. This article uses Like “*” in the IIF statement to return all records where no Job No is specified |
Between # And # | Determines whether a numeric or date value is found within a range. |
In(val1,val2…) | Determines whether a value is found within a set of values |
Please Watching My Video is Below
No comments:
Post a Comment