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

Help with Formatting string Field

Status
Not open for further replies.

waslbs92

Programmer
Nov 18, 2002
5
US
I have a string field which can contain either currency or just numeric data. I assume that I can use a formula to differeniate to format these values.

Can someone help me with the correct syntac for the formula.

if condition then numeric else currency...

Thanks you

 
It could be as simple as:

If "$" in {your.field} then "currency" else "number" Mike

 
I'll assume that the first character is a $ in the event of a currency:

if left({MyTable.MyField}) = "$" then
"it's currency"
else
"It's numeric"

A string field is neither a currency nor numeric data type, though it may have some identifiers to differentiate what is stored.

In either case, the formatting is probably fine as is, if you need further assistance, try posting examples of what you have, and what you want.

-k kai@informeddatadecisions.com
 
Actually, I am receiveing string data and need to format it to either currency or numeric based on the value of a different field in the record.

How would I use a formula to format the string field to either currency or a number...


Thanks
 
Right click on the field you want to change.
Pick Format Field/the Number tab/Customize Button\Currency Symbol\Enable Currency condition format button(x-2)

Enter you formula here:

if {your.field}=something
then 1 or 2
pick either 1 or 2
//1 results in floating currency symbol, while 2 gives you a "tight" symbol
1: $ 1,000
2: $1,000

Mike

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top