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 derfloh 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 formula for paid amount

Status
Not open for further replies.

grecon

Technical User
Mar 8, 2007
78
US
Hi I have this formula:

IF {PAYLIST.AMOUNT}<0 and {PAYTYPES.PAY_TYPE}="014" then {PAYLIST.AMOUNT} else
IF{PAYLIST.AMOUNT}<>{PAYLEDGER.AMOUNT}then 0 else
{PAYLIST.AMOUNT}


Now I want to add to it so it will also show the credits which are CREDITLEDGER.AMOUNT, right now I have the credits in a seperate column but I want them in the same column as the Paid Amount. I am just starting out in this so I'm not sure how to this, thanks.
 
I don't think this is quite what you are asking, but....
you can add the field to your formula like this to display the data (assuming the table joins are all correct) and it will display the Paylist.Amount, a space, and the CreditLedger.Amount side by side.

IF {PAYLIST.AMOUNT}<0 and {PAYTYPES.PAY_TYPE}="014" then {PAYLIST.AMOUNT} &" "& {CREDITLEDGER.AMOUNT} else
IF{PAYLIST.AMOUNT}<>{PAYLEDGER.AMOUNT}then 0 else
{PAYLIST.AMOUNT} &" "& {CREDITLEDGER.AMOUNT}
 
that gives me an error message, says a number is required here {PAYLIST.AMOUNT} &" "& {CREDLEDGER.AMOUNT}
 
change the 0 to ""
there will be a problem if you are needing to perform any calculations, as it does make it a string.
 
Is PayList.Amount null when CreditLedger.Amount is not null?

-LB
 
yes, I just want everything in one column instead of listing paid in one and credit in another
 
if isnull({paylist.amount}) then
-{CreditLedger.Amount} else //assumes the credit is positive
if isnull({CreditLedger.Amount}) then
(
IF {PAYLIST.AMOUNT}<0 and
{PAYTYPES.PAY_TYPE}="014" then
{PAYLIST.AMOUNT} else
IF{PAYLIST.AMOUNT}<>{PAYLEDGER.AMOUNT}then
0 else
{PAYLIST.AMOUNT}
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top