• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

QuickReports Question

I have a table with a similar structure to this:

Index - AutoInc field
UserId - integer
Amount - integer
Date
Time

This is an audit type report where each UserID will have more than one record. I need to produce a report showing totals per UserID with the UserID with the highest total appearing frst in the report and then decsending to the dude with the lowest.

Is this possible WITHOUT having to pre-process the data ?
0
RLancaster
Asked:
RLancaster
1 Solution
 
simonetCommented:
Yes, just build a query (SQL) that already arranges the data the way you want. Then use that query as the datasource for the QuickReport.

On the query below, I assumed that you want to show the totals, that is, the sum of all the amounts for a specific UserID.

SELECT USERID, SUM(AMOUNT) AS TOTAL FROM MYTABLE
GROUP BY USERID
ORDER BY TOTAL DESC

That has been tested against a Paradox table with a strutucture similar to yours and works.

Now just add a TQuery to the form, w/ the SQL above, link it to the TQuickRep component and QRBands, QRDBText, etc, and you're all set.

Yours,

Alex
0
 
RLancasterAuthor Commented:
thanks dude !!!
i just managed to get it working all on my own but because of your prompt and accurate response I am giving you the points any way :) ... and an excellent rating
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now