This topic is locked

search records with filter from different tables

6/19/2007 6:46:31 AM
ASPRunnerPro General questions
M
maurello author

I have to tables with a relationship one to many, such as Orders and Order Details.

In the Orders table I have fields like: Customer, Shipping Date, Order Date, Total ($), etc

In the Order Details I have fields like: Item, Description, Category, Quantity, Sales Price, etc
ASP Runner generates obviously two different *_list.asp pages for Orders and Order Details, and we can drill-down from Orders to Order Details via a link (automatically generated as well).

However, we would like to search at the Orders level all the orders where customers bought books for example. So I would like to perform a search against the Orders list selecting the Category as criteria, although it belongs to Order Details.

This can't be done creating a unique view on the database side, because otherwise the Orders list would have duplicates/repetitions in order to accomodate the one to many relationship.
How could this be done and if now it is not possible, will it be implemented in the future?
Thanks!

M
maurello author 6/21/2007

Any answer to this question?

M
maurello author 6/25/2007

Does anyone has the same problem?
In order to give flexibility it would be of great help to be able to search based on fields available in other tables. The only work possible around now is to merge everything in one unique query, and compromise with duplicates.

Sergey Kornilov admin 6/26/2007

I'm not aware of generic solution. Basically you need to run a search on Order Details, get a list of orders, eliminate duplicates and join this list with Orders table itself. Sounds like a job for a stored procedure or for a view.

3817 4/11/2008

Hi maurellio,
I have exact the same problem. Did you already manage to solve this problem?
Cheers, AlMai