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!

if then make amount a negative nuber

Status
Not open for further replies.

darahw

Technical User
Feb 27, 2003
74
US
Hello.

I will thank you in advance for your help.

I am in the formula editor and I am trying to write a formula like this but I have the incorrect syntax The bold is what I don't know the correct values for:

If payment_detail.account='CM' then payment_detail.amount SHOULD BE A NEGATIVE NUMBER

Please help!!

Thanks again,

Dara
 
If {payment_detail.account}='CM' then -{payment_detail.amount}

Note the minus sign before the field.

-LB
 
I get a message:

The formula must result in a boolean.

Am I doing something wrong?
 
Can you copy and paste your formula here and also verify the datatypes for both fields?

-LB
 
Where are you attempting to place this formula?

It sounds like you're using the record selection or some sort of formatting.

To limit rows in the record selection formula, try:

payment_detail.account='CM' and
payment_detail.amount < 0

This ststes that only rows which match this criteria will be retrieved.

It's generally best to post example data and expected output, that way people understand your environment and requirements

-k
 
this is my formula:

if {payment_detail.account}='CM' then -{payment_detail.amount}

payment_detail.account- the values for that are either 'Check' or 'CM'

payment_detail.amount- is the amount for the check or the credit memo.

So what I need to do is- if the payment_detail.account is a CM then payment_detail.amount is a negative value.

Does this help?
 
This formula should work--it works for me for displaying the negative amount. But SynapseVampire has a good point-- where are you trying to place this formula?

-LB
 
I am right clicking on the payment_details.amount field and selecting, format field, and on the Common tab, I am clicking on the formula button to the right of supress.

That is where I am trying to enter this formula.

I also created a new formula field and I get the boolean error message then too.


Thanks very much.
 
I'm still not clear on your goal, but if you are trying to suppress the amount field if it is negative, then in format field->suppress->E-2 button use:

{payment_detail.account}='CM' and
{payment_detail.amount} < 0 //this assumes the amount is already potentially negative

If you are trying to change the display of the amount to a negative number only when the account is CM, then go to the field explorer->formula fields->new, create this formula {@adjustedamount}:

if {payment_detail.account}='CM' then -{payment_detail.amount} else {payment_detail.amount}

Then use {@adjustedamount}in your detail field instead of {payment_detail.account}

-LB
 
thank you.

That is exactly what I was trying to do.
 
Do you only want a negative when it's {payment_detail.account}='CM'?

Sort of an odd requirement.

If you always want a negative sign for negatives, use:

right click the field and select
format field->Number->Customize->Change negatives to -123.

No formula is required.

If only for &quot;CM&quot;, click the X-2 next to the Negatives and place:

if {payment_detail.account}='CM'? then
-123

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top