Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Limiting records

edited August 2006 in General
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

Comments

  • edited August 2006
    Hi Daniel,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2006
    Nico Cizik (Digital Metaphors) wrote:


    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?
  • edited August 2006
    Hi Daniel,

    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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.