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

Paradox 7 Division of Field Totals

Status
Not open for further replies.

FITZJ

Technical User
Jan 27, 2003
3
GB
Hi I am trying to total a field which contains the numerics
"4" and "6".This works fine but ideally I want to display the answer as half of the total.
I can get this to work in a report by ending the calculated field with"/2" but unable to do it with query??
Also when I use calculated fields in a report I seem to get a page produced for every formula..........any help would be greatly appreciated.
PS. Not using code only summary operators.
 
FITZJ,

You didn't say which version of Paradox 7 you're using, e.g. the 32-bit version (for Windows 95/NT) or the 16-bit one (for 3.x and WFWG). If the former, I'd suspect your page break problems are being caused by problems that were fixed in a patch, which can be obtained from Corel (
As far as getting the division to work in a query, be sure to use parentheses to control the calculation. For example:

Code:
( _a * _b ) / 2

Hope this helps...

-- Lance
 
Thanks for replying Lance.....what I'm trying to do is set an example to the total eg.
calc total/2 or calc sum/2.
Perhaps it cannot be done but it is such a simple operation that I feel sure I'm missing something.
I'm using Paradox 7 32bit for win95/NT as you rightly suspected.
Will try the patch as regards the page per record problem....Thank You.
John.
 
John,

According to the information on Corel's site, the patch may help with the page per record problem. The last item in their fix list covers page breaks in group footers. Without actually seeing your report (or trying it out), I can't say exactly if the patch will help, but I know it fixes a bunch of things, so it should help stability if nothing else.

Be forewarned, that particular patch is a pain to install. It'll take about 30-45 minutes overall. Read the instructions very carefully. I've found it helpful to print them out and mark off each step as I perform it.

Now, as far as the query totals go, you may have a couple of things you need to do:

1. Remember that CALC SUM has a third parameter, which controls how the summaries are calculated. Specifically CALC SUM UNIQUE totals only the unique values and CALC SUM ALL totals all of them. I believe the operation defaults to ALL, but I can't recall the speficis off the top of my head.

In any event, I usually provide the operator, just in case the default isn't what I remember it do be, thus start by specifcying CALC SUM ALL.

2. I've not tried this myself, but as I understand QBE, you should be able to add parenthesis to the CALC SUM operation and modify the values accordingly, so try CALC (SUM ALL) / 2 and see if the query will run.

If it won't, then you'll need to use two queries, one to do the summary calculations and a second to divide the results.

Hope this helps...

-- Lance
 
Hi Lance,
unfortunately the CALC (SUM ALL) / 2 idea does not work and quite honestly I think it can only be done in 2 steps.
However the patch seems to have cleared up my multiple page
problem and so now it is feasible again to use a report to
get the required results.
Thanks a lot for your help and prompt replies.
Cheers
John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top