LeftStr SQL Function to get left side of sub string

The LeftStr(String or Value , Length) function takes two arguments a string or value and number of characters, it returns the number of characters defined as second parameter of first value. The B or number of characters should be between 0 and length of value other wise a NULL is returned. Function only works with Text and Integer type values to work with other values see SubStr function.

SELECT LeftStr('SQLDatabase.Net', 3) /* returns : "SQL" */ ;

SELECT LeftStr(1234, 3) /* returns : "123" */;

LeftStr works similar to Visual Basic LEFT function.