Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-05-01 : 13:41:11
|
Daniel writes "I am in need of guidance. I have a database with many-to-many (or one-to-many and another many-to-one relationship) relationships. Here is an example of what it looks like:
Table Name: Facilities Fields For Facilities: FacilityID, FacilityName
Table Name: Products Fields For Products: ProductID, ProductName
Table Name: ProductCategories Fields For ProductCategories: ProductCategoryID, ProProductCategoryName
(below are the relational tables)
Table Name: FacilityProductRelation Fields for FacilityFacilityProductRelation: FacilityID, ProductID
Table Name: FacilityProductCategoryRelation Fields for FacilityProductCategoryRelation: FacilityID, ProductCategoryID
Table Name: Products&CategoryRealtion Fields for Products&CategoryRealtion: ProductID, ProductCategoryID
What I am doing is, a user goes to a page selects a facility type. They then are sent to a page that displays all the product categories associated with the facility type. The user has the option of selecting a single product category or all the categories listed (it is a drop down list of product categories and an All categories selections). What I want displayed are all the products associated with the product categories that are also associated with the facility types. There is a twist, however. For example ProductID 1 may related to ProductCategoryID 7, and ProductCategoryID 7 is related to FacilityID 2, but ProductID 1 isn't related to FacilityID 2 so ProductID 1 would not be displayed.
I am using Access2000 and Windows2000 Server (SP1) running IIS5. Thank you." |
|
|
|
|