Str() and StrComp() Function in MS Access
Last Updated :
31 Aug, 2020
1. Str() Function :
In MS Access, the Str() function return a number in the string format. In this function, we can pass any number the function will return that in the string format.
Syntax :
Str(number)
Example –
SELECT Str(100) AS ConvertToString;
Output –
Example –
SELECT Str(421) AS ConvertToString;
Output –
2. StrComp() Function :
In MS Access, The StrComp() function compare two strings . It will take two parameter string1, string2 as the parameter. If both strings will be same then it will return 0, and if the first string is greater than second then it will return 1 if string1<string2 then it returns -1 and if string1 or string2 is null then it will return null.
Syntax :
StrComp(string1, string2)
Example –
SELECT StrComp("geeksforgeeks", "gfg") AS CompString;
Output –
Example –
SELECT StrComp("gfg", "geeksforgeeks") AS CompString;
Output :
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...