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!

If Then Else help String versus Number

Status
Not open for further replies.
Feb 15, 2006
3
I have a formula I am trying to write...

If {field} (which is a number) = {Field2} (which is a string. I need to pull the first 4 characters from the second field)
then {field 3}
else {field 4}

I am having an issue getting the field and field 2 to work like I am thinking it should.

Andrea
 
Hi Andrea

If totext({field})={field2} then {field2}[1 to 4]

you need to compare apples to apples so if I understand correctly just convert the number field totext.

You may have to add totext({field},0) to control the number of decimals or totext({field},0,"")and whether there is a thousand seperator.

First just play with the totext function so you understand what your number looks like when converted to text.

Gordon
Crystalize
 
Gordon,

Thank you very much that works great!!!

Andrea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top