comparing sum values [message #215992] |
Wed, 24 January 2007 09:54 |
chris81
Messages: 4 Registered: January 2007
|
Junior Member |
|
|
Hi:
I wrote this code that gives displays the total mileage per car and total mileage per contract:
COLUMN ContractNo FORMAT 099 HEADING 'Contract No'
COLUMN CarReg FORMAT A9 HEADING 'Car Reg' JUSTIFY LEFT
COLUMN DriverNo FORMAT 9999 HEADING 'DriverNo'
COLUMN MILEAGESTART FORMAT 9999999 HEADING 'Start Mileage'
COLUMN MILEAGEEND FORMAT 9999999 HEADING 'End Mileage'
BREAK ON ContractNo SKIP 1 ON CarReg ON REPORT
COMPUTE SUM OF TOTAL_MILES ON ContractNo REPORT
SELECT ContractNo, CarReg, DriverNo, MILEAGESTART, MILEAGEEND, (MILEAGEEND - MILEAGESTART) TOTAL_MILES
FROM Contract_Car;
My Question is this is there a way I can compare the Sum total against in my case a total mileage allowed field in a where statement?
Thanks for any help.
|
|
|
|
|
|