Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems sorting a TCBMemSet

Status
Not open for further replies.

tjcusick

Programmer
Joined
Dec 26, 2006
Messages
134
Location
US
My program searches through some DBF tables for certain records and when if finds them it populates a MemSet with 3 pieces of information, EventType, EvenName, and EventTotal. This part works great, the problem is when i take that table and try to send it to a Rave Report and total up the EventTotal information, the information is not in a sorted order. I kind of expected this since im just pulling information randomally from the table in no specific order but before i do the report I Open my table up and do a .Sort; on it. It seems to work for the overall EventType but not the EventName. How can i tell my code to sort this first by the EventType and then by the EventName.. Or can i just specify it to sort on the Name?

Any Help is Appreciated.

Tom C
 
If the DB provider allows you to use SQL, then I would go that way first. ie. instead of using a TTable component to access your DBF, use a TQuery, and construct your SQL like this:
Code:
SELECT * FROM EventTable
ORDER BY EventType, EventName
You can insert a WHERE clause between those lines to only select some records. Depending on your criteria, this may be a simpler and quicker way of gathering only the data you want.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top