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

Need help with Type Conversion

Status
Not open for further replies.

Lucieann

Technical User
Aug 29, 2003
35
US
LOAN1301.CollCode (Text field)
LOAN1301.Balance (Currency field)
LOAN1301.DirectDebt (Currency field)

What I want to do is if LOAN1301.CollCode is NOT a number, I want to return the LOAN1301.DirectDebt value with a label of "Direct:" in front of it. Other wise I want it to return the value in the balance field with no label.

I am trying to use the following formula:

If NumericText ({LOAN1301.CollCode}) then {LOAN1301.Balance}
else "Direct: " + {LOAN1301.DirectDebt}


The problem with this formula is that I get the message "A string is required here." on the LOAN1301.DirectDebt field. I know that I somehow need to convert the type of data, but I don't quite know how.
 
Try this:

If NumericText ({LOAN1301.CollCode}) then
ToText({LOAN1301.Balance})
else
"Direct: " + ToText({LOAN1301.DirectDebt})

Once your balance and direct debt fields are converted to text, you will lose the $ formatting. If you need it, you will need to add it in the string. ( "Direct: $" )

~Brian
 
That works great!! Do you know if there is any way to right justify the DirectDebt without moving the "Direct: "label?
 
Not without breaking them out into seperate formulas.

Try this:

Change your first formula to this:

If NumericText ({LOAN1301.CollCode}) then
{LOAN1301.Balance}
else
LOAN1301.DirectDebt}

This will just return either field. They are both currency field so you can format them with dollar signs and right align them.

Create this second formula, which is a slight variation of your original formula:

If NumericText ({LOAN1301.CollCode}) then
""
else
"Direct: "

Place this on the report to the left of the first formula. You can now right justify the currency field.




~Brian
 
That works great! Thanks for all your help!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top