Page 1 of 1

Counting Characters

Posted: Wed Aug 07, 2002 11:07 am
by lantaz
Does anyone know how to create or derive how many characters are in a field? We have a procedure where we add an "S/A" to the beginning of name field, the field has a total of 38 characters. I have a calculated field where it checks for an "S/A" using LEFT(VS_BUS_NM,3), I want to be able to take away the "S/A" and leave the name only... I^ve tried the RIGHT(VS_BUS_NM,35) option but does not work since the name lengths vary, does anyone have an idea on how I can get this working? If I could know the number of characters that the field has, I would be able to incorporate the RIGHT command with better results... I am currently using SQL Edition V8.1

=> RE: Counting Characters

Posted: Wed Aug 07, 2002 11:15 am
by Tom_Freitas_(Guest)
I^m sure the SQL has some of the same features of xbase. A simple command would be len(rtrim(field_name)) len is for length, rtrim is for rtrim.____

=> RE: Counting Characters

Posted: Wed Aug 07, 2002 12:31 pm
by Randal_Ferguson_(Guest)
Thanks__your suggestion worked great for what I needed...

==> RE: Counting Characters

Posted: Wed Aug 07, 2002 1:10 pm
by lantaz
I don^t know if this function is available in the SQL version but:____substr( mystring, 4)____will extract everything starting in position 4 of the string.____Randal Ferguson