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

How can I sort the records in a table?

Status
Not open for further replies.

shelbytll

Programmer
Dec 7, 2001
135
SG
Please note that it is not "Order by" in SQL statement.
I just want to sort the records when I open up my table to browse I am a clever newbie...[peace]
 
Try to create some indexes eg . Index on fieldname tag yourTagname see MSDN. Thanks for sharing your knowlege.
 
HI
You can create a view for this purpose and index the view on the fly with CDX type as per the requirement/needs.

Probably in the click event of the header in the Browse Grid, you can create the index as needed on the view.

When the view is closed, the index gets deleted. This way the index does not bloat the data table. The down side is the indexing activity. SO, if the tables are not very large, indexing can be done on the view. If it is very large, then do it on the main table. Also, think that if the view opens up only small amount of data at a time, then this is handy irresptive of large or small table.

HOpe this idea helps you :)

However, if you are loading the records in a memory array, then you can sort by using ASORT command.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
actually i want to sort the records because I want to do some edit and paste. By sorting some thing fields, it makes copying and pasting easier for me... I am a clever newbie...[peace]
 
Have you looked at the SORT Command? The only "problem" is that you need to open the table exclusive and it can require as much as 2.5 times the size of your table in free space on disk. (It's also "slow" compared to indexing!)

Rick
 
the best way to get certain records in the order you want that is only a temporary condiction is to use the SQL select. using WHERE (other choices are joins, order by) Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top