Limiting records
I have a paradox table with a bunch of records that I want to show in a
report. Two of the fields are currency fields and I only want to
retrieve records where the difference between the two currency fields is
high enough (specified by a user).
"Give me all the records where the difference in premiums is greater
than 15%".
I am having trouble getting a (QBE) query to filter the records with
this logic, so I was just wondering if I could hide detail records that
didn't meet the % difference inside my report somehow. I have two
variables on the detail band. One to calculate and show the $ difference
between the two currency fields and the other shows the % difference.
srdaniel
report. Two of the fields are currency fields and I only want to
retrieve records where the difference between the two currency fields is
high enough (specified by a user).
"Give me all the records where the difference in premiums is greater
than 15%".
I am having trouble getting a (QBE) query to filter the records with
this logic, so I was just wondering if I could hide detail records that
didn't meet the % difference inside my report somehow. I have two
variables on the detail band. One to calculate and show the $ difference
between the two currency fields and the other shows the % difference.
srdaniel
This discussion has been closed.
Comments
My first recommendation would be to create a calculated field in SQL that
calculates the difference percentage between the two fields, then add a
search condition to only return the records greater than 15%.
Something like..
Select Field1, Field2, ((Field1/Field2)*100) FieldPercentage
From Table
Where ((Field1/Field2)*100) > 15
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
That is what I'm trying to do, but I'd rather use a QBE since it's
paradox and they are noticably faster than using a TQuery. However I
don't know QBE's so I'm waiting on a another newsgroup question.
Lets say it was impossible to do so with SQL, could it be done within
the report itself?
The issue is where to make the calculation. Try setting the visibility of
the detail band inside the OnCalc event of the variables you are using. If
this is too late to set the visibility of the band, you can try to make the
calculation in an earlier event such as the OnBeforePrint. Note that under
normal circumstances you should never make calculations in any other event
than the OnCalc of a TppVariable. You will most likely need to add some
logic to the BeforePrint event to ensure it only fires once per traversal.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com