PhilipEwen
Registered User.
- Local time
- Today, 19:32
- Joined
- Jun 11, 2001
- Messages
- 81
Hi,
I have a contact database which by selecting tick boxes additional forms appear with list boxes. there are currently 2 tickboxes/list boxes. 1 for industry sectors and 1 for client relations type.
Therefore if a user ticks the boxes, ( as an example ) they can search for all companies within "construction" AND "engineering" who are "existing client" OR "ex-client". All this data is read from a single company table.
The list boxes allow for the selection of multiple criteria - these are then parsed to the main search form. Once 'Search' is clicked, a query is built with these criteria. All fairly easy.
Added functionallity is now required to allow users to search under staff to company relations. Because more than one staff member can be related to a company, a separate table has been created which holds the staffid and company id.
Therefore what i want to do is search for all companies within "construction" AND "engineering" who are "existing client" OR "ex-client" AND in my "staff to company table" where companyid=staffid AND companyid=staffid ( for multiple staff )
I was wondering if a rather complex query can be built to do this, or if a better way would be to generate a dynamic table based on the first lot of results ( industry sectors and client relation ) and then re-query that table to work out the staff to company relation.
Any advice is welcome ( and code snippets too !! )
Many thanks
Phil.
I have a contact database which by selecting tick boxes additional forms appear with list boxes. there are currently 2 tickboxes/list boxes. 1 for industry sectors and 1 for client relations type.
Therefore if a user ticks the boxes, ( as an example ) they can search for all companies within "construction" AND "engineering" who are "existing client" OR "ex-client". All this data is read from a single company table.
The list boxes allow for the selection of multiple criteria - these are then parsed to the main search form. Once 'Search' is clicked, a query is built with these criteria. All fairly easy.
Added functionallity is now required to allow users to search under staff to company relations. Because more than one staff member can be related to a company, a separate table has been created which holds the staffid and company id.
Therefore what i want to do is search for all companies within "construction" AND "engineering" who are "existing client" OR "ex-client" AND in my "staff to company table" where companyid=staffid AND companyid=staffid ( for multiple staff )
I was wondering if a rather complex query can be built to do this, or if a better way would be to generate a dynamic table based on the first lot of results ( industry sectors and client relation ) and then re-query that table to work out the staff to company relation.
Any advice is welcome ( and code snippets too !! )
Many thanks
Phil.