Welcome! Log In Create A New Profile

Advanced

Filter for a Table

Posted by Dan Matis.pcs.crosspost 
Dan Matis.pcs.crosspost
Filter for a Table
December 09, 2008 05:30PM
WebDev12

Newbie here, I have a program where I am showing 1 company (on top) then I have a tab below which on one of the tabs I am trying to show only the related contacts for that company in a table ...

How do I filter? to only show the related contacts?

Thanks in advance ... Dan

Message forwarded from pcsoft.us.windev
Milton
Re: Filter for a Table
December 09, 2008 08:04PM
Hi Dan,

The best way to filter on the related contracts would be to populate the table with a query which uses a common index, such as contract number, as its selection criteria. For example, I have a table called PROJECT with another table called DETAILS and I want the DETAILS table to just show the child records of the parent PROJECT. The code below is an SQL representation of a query I constructed in Windev using HF Classic tables.


SELECT
Details.ProjectID AS ProjectID,
Details.Task AS Task,
Details.Ranking AS Ranking,
Details.StartDate AS StartDate,
Details.EndDate AS EndDate,
Details.Type AS Type,
Details.Days AS Days,
Details.Person AS Person,
Details.AddDays AS AddDays
FROM
Details
WHERE
Details.ProjectID = {Param1}
ORDER BY
Ranking ASC


"Param1" is the Project ID and when I run the query I introduce it as shown below where Param1 is ProjectID form the parent table.

HExecuteQuery(DetailsQuery,hModifyFile,ProjectQuery.ProjectID)
TableDisplay(Table_DetailsQuery)



HTH
Milton
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: