Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subtotals and totals
Message
From
12/07/2006 13:22:54
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
12/07/2006 11:39:26
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01135680
Message ID:
01135783
Views:
11
>Rather than trying to fix what I've apparently done wrong, can someone just tell me how to do it correctly from the start?
>
>Here are some of the fields in my cursor:
>
>order_no, qty, price, frt
>
>Here are a few sample records for order #100:
>
>100, 10, 1.23, 50
>100, 20, 2.00, 50
>100, 10, 1.50, 50
>
>As you can see, "frt" is in each record, but is the total freight for the order.
>
>My invoices show all three detail lines:
>
>QTY 10, $1.23/ea $12.30
>QTY 20, $2.00/ea $40.00
>QTY 10, $1.50/ea $15.00
>
>Then the subtotals look like this:
>
>SUB: $ 67.30
>FRT: 50.00
>TOT: $217.30
>
>The FRT is showing correctly as $50, but is adding $50 three times (once for each detail line).
>
>Suggestions for changes to my form?

No, but a suggestion for changes to the code which prepares your cursors: blank the frt_chrg on any record that isn't the first (or last, depending on which one you print) record for the order. So you'd have it only once; it'd still add it six times, but the other five would be zero and you'd get the correct total.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform