<< Click to Display Table of Contents >> Navigation: Data Module > Import & export > Data mappings > SQL Basics > Functions > String |
Name |
Example |
CHRW |
select description + chrw(13) + cpu + chrw(13) + memory from [item_info] Equivalent to SQL-Server CHAR and NCHAR functions. |
ASCII |
select ASCII('test'), ASCII(NULL) |
LOWER |
select lower(description) from [item_info] |
LTRIM |
select ltrim(description) from [item_info] |
RTRIM |
select rtrim(description) from [item_info] |
TRIM |
select trim(description) from [item_info] |
UPPER |
select upper(description) from [item_info] |
REPLACE |
SELECT replace('abcdefghicde','cde','xxx'), replace('abcdefghicde','CDE','xxx') Note that Replace is case-sensitive. |
SUBSTRING |
SELECT SUBSTRING('abcdefghicde', 1, 3) |
CHARINDEX |
SELECT charindex('abc', 'xyzabc123') |
LEN |
SELECT [len]('test') |
LEFT |
SELECT [left]('test', 2) |
RIGHT |
SELECT [right]('test', 2) |
Notes:
Given the following .NET code; DateTime.Now.Subtract(certainDate).TotalDays, the equivalent SQL function calls would be SELECT DAY(SUBTRACT(GETDATE(), certainDate)) FROM table