Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to sort rows in grid using lookup field column?

Posted on 2001-06-11
7
Medium Priority
?
353 Views
Last Modified: 2007-12-19
Hi,

Is there anyway to sort rows in grid using column that is based on lookup field?

The grid contains one lookup field that is pointing to the master file record ( i.e. EmployeeName ), I need to sort the rows based on the Employee's Name.  How?

Thanks
0
Comment
Question by:llkhor
6 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 200 total points
ID: 6176242
Hello

  If you want to sort ur data in ur grid, you need to do that in the dataset (table or query), for table, make an index in the field that u want to sort on, then from table property
IndexFieldName = anyindexfield u make

or u can use the query and order by to sort any field u like, in the query component sql text:
'select * from customer oder by company' if you want to sort ur data using the company field

also you can download some dbgrid from torry that could sort ur data
http://www.torry.net/db_grids.htm

Best regards
Mohammed Nasman
0
 

Author Comment

by:llkhor
ID: 6176586
mnasman :  I know both the methods you described, i am just curious if u could do sorting with lookup field (kind=fkLookup) instead.  

Thanks.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6176991
only with a query by including the field, which is referenced like

select a.*, b.lookupresultfield from tableA a, tableB b where a.lookupidfield = b.idfield order by b.lookupresultfield

in some databases b.fields must not be included into the fieldlist after the select in some other databases is this a must

meikl ;-)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:llkhor
ID: 6179607
Thanks for the feedbacks....  
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8451579
Upon review of the comments here, I am recommending this disposition:

        points to mnasman

Please post a comment if you disagree.

DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8492512
per recommendation.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question