Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find "tab" in string field?

Status
Not open for further replies.

patti2

Technical User
Nov 7, 2003
8
US
Good morning,

I am using CR 8.5 with ODBC to Sybase db. I have a table with multiple string fields that are populated thru electronic customer correspondence. Some of these fields contain embedded tabs, which is causing a bcp to fail.

Is there a way to select just the fields that contain a tab? Something like %\t%?

Thanks in advance.
 
The ascii code for a horizontal tab is chr(9). So, you'll need to look for that character in the field.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Specifically, use a selection formula like:

instr({table.field},chr(9)) <> 0

-LB
 
Thanks to both of you. I will admit, I was struggling with the syntax a bit in my select statement. But I did finally get it (with the help from another thread on this site!) with the following:

{table.field_1} like "*" & char(9) & "*" or
{table.field_2} like "*" & char(9) & "*" etc.

Thanks again for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top