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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to sort the table in descending order 1

Status
Not open for further replies.

novice001

Programmer
Jun 7, 2002
18
US
Hi All,
I'm trying to sort the table descending. The problem is that the table is the answer table generated from the query and i don't know how to specify secondary index.
I tried this:

rptQuery = Query
ANSWER: :private:Detail2.DB
:Data:DETAIL.DB | Lot Id | Customer No |
| Check | Check ~(customer_no) |
EndQuery

if rptQuery.executeQbe(":private:Detail2.DB") then

tbCust.attach(":private:Detail2.db")
INDEX tbCust
DESCENDING
MAINTAINED
ON "Lot ID"
ENDINDEX
endif

This gives me the table with secondary index "Lot ID" sorting descending, but when I create report with this table I cannot assign this index in the format\filter. Paradox shows this index there, but doesn't allow me to choose it. What am I doing wrong?
Thank you.
 
Hey Novice001

Not sure why that isn't working, although I tend not to use that syntax having tried it once without success.

I use the setIndex and dropIndex methods when adding and removing indexes to Tables, give those a try if you get stuck.

Steve
 
For a report, you may not need to create the index at all. On the report, select the record band, right click and set up the required sort from there.
 
NotAllThere, Thanks a lot!
That's what I needed, I didn't know I can specify the sort order on the report.
Probably that's why it didn't allow me to use another index in filter, because it can be done much easier.
Thank you all.
 
novice001,

Remember that reports will always sort answer sets in order of the group bands in the report. You can frequently save time by a) removing sorting groups from the report (if possible) and b) adding the sorting to the query itself.

It's a query property interactively and an extra string at the beginning of code-based QBF queries. Save an interactive version of the query to a QBE file to obtain the appropriate string.

If you need sorting groups in your report, save time by not sorting the results of the query itself.

Hope this helps...

-- Lance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top