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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing char "F" from the string 1

Status
Not open for further replies.

rekhatr10

Programmer
Apr 2, 2004
67
0
0
US
Hi everyone,

CR 7.0
datbase sql server 2000
I have a fiedl where ihave to take out the first charcater which happends to be F and display all the other num. How can I do that.

Thank in advance for your help
REkha
 
There are probably many different ways to do it. This should work with CR7:

Right(Trim({Table.Field}),Len(Trim({Table.Field}))-1)

-dave
 
Dave,

I get an error
Right(Trim({Table.Field}),(error)Len(Trim({Table.Field}))-1)
AM I missing something?

Rekha
 
Dave,

The number will be

F23434343

I need to display only 23434343. I did get your formula working but it gives me that string is < 0.


Rekha
 
Rekha,

Use the mid function:
Mid({Table.field},2)

MrBill
 
You must have some records that are blank, or NULL. Try checking the field first:

If (IsNull({Table.Field}) Or {Table.Field} = "") Then ""
Else
Right(Trim({Table.Field}),Len(Trim({Table.Field}))-1)

-dave
 
Try MrBill's solution or just use a replace function:

replace({table.field},"F","")

-k
 
Dave

You were right I had null values& the if statmetn took care of that and it worked like a charm.

Thank you so much
Rekha
 
Dave,

in crystal you have to spell length({the file}otherwise it givesan error.

RR
 
RR: Dave's code is correct (he's using Crystal Syntax, not Basic syntax), and the function isn't against a file, it's against a field and requires a terminating parenthesis.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top