bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

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