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

Different Results from formulas on 1 of many PC's

Status
Not open for further replies.

TreeGuy

Programmer
Oct 1, 1998
5
US
Anyone have an idea as to why results on a report would be different on one PC as opposed to another? We are running a report from an accounting package and we know that it is running the same report on 2 different PC's with the same datasource. We have check into the possibility of bad DLL with no luck. The formula does have a nested IF and the only functions that are being used are ToText(), ABS() and Right().
The formula does work correctly in the report when generated on several different machines but produces different results on one specific machine.

Thanks for any suggestions in advance.
 
What is the formula? What are the results on the different machines?

Big stab in the dark without knowing specifics...

Check the default number setting. Go to File/Options... Fields tab, Numbers button. On the numbers tab, check to see that the numbers are formatted the same.

Why? - When the totext() function is used, it formats to the default format. For example - Totext(5000.5) on my machine formats to 5000.50 (format is set to 2 decimals and no thousands seperator), while the same formula results in 5,001 on a colleagues.

Mike
 
Here's the actual formula:

The results were that values were in effect switching columns or not being evaluated into the correct columns on the report. But this only was true for one specific PC. As I mentioned before, the rest of the PC's that have run the report are generating correctly the same and consistant output.

It's just strange that the output was different and there were no error messages indicating any kind of problem which is spooking the accounting manager making her wonder what other discrepencies might have been forwarded on to our clients.



WhilePrintingRecords;

Numbervar AdvPay;
Numbervar PrePAC;
Numbervar SecDep;
Numbervar AR;


if ({ARDoc.User2} = &quot;A&quot; and Right(ToText({@DocBal}),5) <> &quot;00.00&quot;)
or ({ARDoc.User2} = &quot;A&quot; and Right(ToText({@DocBal}),5) = &quot;00.00&quot;and Abs ({@DocBal}) > 20000)
then AdvPay := AdvPay + {@DocBal}
else
if ({ARDoc.User2} = &quot;D&quot; and Right(ToText({@DocBal}),5) <> &quot;00.00&quot;)
or ({ARDoc.User2} = &quot;D&quot; and Right(ToText({@DocBal}),5) = &quot;00.00&quot;and Abs ({@DocBal}) > 20000)
then PrePAC := PrePAC + {@DocBal}
else
if Right(ToText({@DocBal}),5) = &quot;00.00&quot; and Abs ({@DocBal}) < 20001
then SecDep := SecDep + {@DocBal}
else
if ({ARDoc.User2} = &quot;P&quot; and Right(ToText({@DocBal}),5) <> &quot;00.00&quot;) or {ARDoc.User2} = &quot; &quot; or isnull({ARDoc.User2})
then AR := AR + {@DocBal}

 
Bizarre..

The field formatting issue I mentioned will effect your formula.

If one person has three decimals set up on the machine as the default, this part of the formula:
Right(ToText({@DocBal}),5) <> &quot;00.00&quot;)
would be true for every number that was evaluated. The number 100 would end up being 100.000 with the right 5 charactes being &quot;0.000&quot; If the default on the machine is 2 decimals the right 5 characters would be &quot;00.00&quot;

Instead of using:
Right(ToText({@DocBal}),5) <> &quot;00.00&quot;) you can use
remainder({@DocBal},100)<> 0 to check to see if a number is divisible by 100





Mike
 
Thanks for your suggestions Mike.

It is kind of an odd formula.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top