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

HELP!! if, then statement

Status
Not open for further replies.

Johnw9433

MIS
Jan 20, 2006
1
US
Hello all please forgive my lack of knowledge with Crystal. I will try and explain as best I can.

Question: We have a report that generates all the tenders taken in for the day at our retail stores. Example, it gives the date, transaction # voids , tender type ( visa, mastercard etc..) The problem we are having is it adds VOIDS to the total sales for the day. Voids are identified in the database by "F" or "T". If there is a VOID we want it to populate the column with VOID and deduct amount from total sales.

Any help would be much appreciated.

John
 
There may be a shorter way to do this but I think this would work.

Create 2 running totals.

1, which I will call VOIDS, will ADD all the values where void = 'T'.

The other, which I will call SALES, will ADD all the values where void = 'F'.

You can then create a formula that would subtract the VOIDS running total from the SALES running total

-- Jason
"It's Just Ones and Zeros
 
Try creating a formula:

//{@amount}:
if {table.void} = "T" then -{table.sales} else
{table.sales}

For the label "Void", if you want to convert the T/F column to read Void, then use:

if {table.void} = "T" then "Void" else ""

If you want some other column to read Void, use:

if {table.void} = "T" then "Void" else {table.otherfield}

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top