Thursday, March 17, 2022

Left function

Returns a Variant (String) containing a specified number of characters from the left side of a string.

Syntax

Left( string, length )

The Left function syntax has these arguments:

Argument

Description

string

Required. String expression from which the leftmost characters are returned. If string contains Null, Null is returned.

length

Required. Variant (Long). numeric expression indicating how many characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in string, the entire string is returned.

Remarks

To determine the number of characters in string, use the Len function.

Note:  Use the LeftB function with byte data contained in a string. Instead of specifying the number of characters to return, length specifies the number of bytes.

Query example

Expression

Results

SELECT Left(ProductID,3) AS FromLeft FROM ProductSales;

Returns '3' characters from left side of the values in the field "ProductID" from table "ProductSales" in column FromLeft.

VBA example

Note: Examples that follow demonstrate the use of this function in a Visual Basic for Applications (VBA) module. For more information about working with VBA, select Developer Reference in the drop-down list next to Search and enter one or more terms in the search box.

This example uses the Left function to return a specified number of characters from the left side of a string.

Dim AnyString, MyStr
AnyString = "Hello World" ' Define string.
MyStr = Left(AnyString, 1) ' Returns "H".
MyStr = Left(AnyString, 7) ' Returns "Hello W".
MyStr = Left(AnyString, 20) ' Returns "Hello World".

String functions and how to use them

2 comments:

  1. Special thanks to HACK VANISH, a professional hacker I’ve been hiring for the past 2 years because, I find him to be an outstanding hacker who has aided me in various hacking related issues, ranging from fixing my poor FICO credit score of about 437 TransUnion, 462 Equifax to 802 plus excellent score, tracking my cheating husband’s phone and currently has helped me recover my lost crypto funds from an online scam investment I recently ventured into, I must confess he is the best, quite brilliant, ever since I discovered him through a positive review I saw on Wallet Hub and reached out to him via Email: Hackvanish @ Gmail. com, and Phone: +1(747) 293-8514, to which he responded in less than 10mins, I have never regretted working with him, he’s been quite helpful and highly efficient. I Would recommend his services to anyone without hesitation.

    ReplyDelete
  2. PINNACLE CREDIT SPECIALIST remains the best credit expertise I have known. I had 23 negative things on my credit that were holding me back. One of them is from Capital one another from sears which I paid off and I am not sure of the others but they are both 6 years old. I filed bankruptcy 5years ago and settled with all of these. My attention was called that they are still on my reports I recently got referred by my best friend to hire (pinnaclecreditspecialist@gmail.com / +1 585 466 4373) which I did and he helped me fix my credit and my score improved by a huge leap. I recommend anyone that needs to fix his or her credit to get through with PINNACLE CREDIT SPECIALIST. He is just the best. Kudos to the entire team PINNACLE!

    ReplyDelete