Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Non-wanted rounding - HELP!!
Message
From
20/09/1999 08:55:06
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Non-wanted rounding - HELP!!
Miscellaneous
Thread ID:
00266662
Message ID:
00266662
Views:
47
I have a report that has two - almost identical - fields. The data for the report is gathered by a large SQL statement and stored in a cursor. Both fields are SUMS of field in a table based off of a starting date. The ONLY difference - field #1 is data from a date in the middle of the month, field #2 is data from the first of the month.
When I print the two fields on the form, field #2 (the "more" data) prints perfectly (ex: $7.50)... field #1 (the "less" data) prints $8.00. More research shows that their is DEFINATELY no additional records for either SUM that causes the descrepency. In addition, any "client" on this report, the "change" is rounded up for field #1.

I have gone as far as copying field #2, pasting the copy on the form and editing the field name to verify their isn't any "hidden" mathematics or other settings causing the difference.




Select client.firmid,client.clientnum,client.clientname,log.logdate,;
sum(iif((code.codetype=="Billings" or ;
code.codetype="WIP Adjustment" or ;
code.codetype="Time" or ;
code.codetype="WIP Start Bal") ;
and log.logdate iif(code.codetype=="Billings",log.rate*-1,log.rate),0)) as BegBal,;
sum(iif((code.codetype="Time" or code.codetype="WIP Start Bal" or ;
code.codetype="Expense")and log.logdate>=gStartDate,log.rate,0)) ;
as Charged, ;
sum(iif((code.codetype="Time" or code.codetype="WIP Start Bal" or ;
code.codetype="Expense")and log.logdate>=gYearBeg,log.rate,0)) ;
as ChargedYTD, ;
sum(iif(code.codetype="WIP Adjustment" and ;
log.logdate>=gStartDate,log.rate,0)) as Adjusted, ;
sum(iif(code.codetype="WIP Adjustment" and ;
log.logdate>=gYearBeg,log.rate,0)) as AdjustedYTD, ;
sum(iif(code.codetype=="Billings" and ;
log.logdate>=gStartDate,log.rate,0)) as Billed, ;
sum(iif(code.codetype=="Billings" and ;
log.logdate>=gYearBeg,log.rate,0))as BilledYTD ;
from Timepro!client inner join timepro!log on client.clientid = log.clientid ;
inner join timepro!code on log.codeid = code.codeid ;
where client.firmid=gFirmid and log.logdate<=gEndDate;
into cursor cursWIPsum ;
group by client.clientname ;
order by client.clientnameHere is the SQL for reference:


Any other suggestions?
Peter Brama
West Pointe Enterprises

VFP is getting easier but STILL alot to learn!!
Next
Reply
Map
View

Click here to load this message in the networking platform