Counting Characters

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
Post Reply
lantaz
Posts: 4
Joined: Tue Oct 10, 2017 12:44 pm

Counting Characters

Post by lantaz » Wed Aug 07, 2002 11:07 am

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

Tom_Freitas_(Guest)
Posts: 32
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Counting Characters

Post by Tom_Freitas_(Guest) » Wed Aug 07, 2002 11:15 am

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.____

Randal_Ferguson_(Guest)
Posts: 51
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Counting Characters

Post by Randal_Ferguson_(Guest) » Wed Aug 07, 2002 12:31 pm

Thanks__your suggestion worked great for what I needed...

lantaz
Posts: 4
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Counting Characters

Post by lantaz » Wed Aug 07, 2002 1:10 pm

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

Post Reply