bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MS Access StrComp() Function

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind MS Access StrComp() Function?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

___("SQL Tutorial", "SQL Tutorial") AS CompString;
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The StrComp() function compares two strings.
Definition and Usage
MS Access StrComp() Function

Example

SELECT
StrComp("SQL Tutorial", "SQL Tutorial") AS CompString;

Definition and Usage

The StrComp() function compares two strings.

The result is returned as an integer based on the comparison:

  • If string1 = string2, this function returns 0
  • If string1 < string2, this function returns -1
  • If string1 > string2, this function returns 1
  • If string1 or string2 is null, this function returns null

Syntax

StrComp(
string1
,
string2
,
 compare
)

Parameter Values

ParameterDescription
string1 and string2Required. The two strings to compare
compareOptional. The type of comparison to perform. Possible values: -1: Uses option compare 0: Binary comparison 1: Textual comparison 2: Comparison based on your database

Technical Details

Works in:From Access 2000

Previous

MS Access Str() Function

Next

MS Access StrConv() Function