Showing posts with label Access. Show all posts
Showing posts with label Access. Show all posts

22 September, 2012

Converting Text to Proper Case or Capital Case or Lower Case in Access

Problem:
Convert text in different format like CAPITAL CASE, lower case and Proper Case in access.

Solution:
You user StrConv fuction for all case.

OR

For UPPER CASE Use UCASE();
For lower case use LCASE();

Syntax:

1) StrConv Function:
StrConv(Target String, Conversion Type)

Target String is a string which you want to convert the string in different case.
Coversion Type:
1 – Converts the string to uppercase characters.
2 – Converts the string to lowercase characters.
3 – Converts the first letter of every word in string to uppercase.

2) UCASE and LCASE

UCASE(Target String)
LCASE(Target String)

Examples:

For CAPITAL CASE.
Select StrConv("Target String", 1); Return: TARGET STRING

For lower case.
Select StrConv("Target String", 2); Return: target string

For Proper case.
Select StrConv("target string", 3);  Return:  Target String