I have written a small app that lets the user create records in a database of a file's location, what department in the company it is relevant to, what category it is in within that and also what subcategory within that.
I have three tables called DocsDept, DocsCat and DocsSubCat. These three tables each have a uniqueID column and a text column.
There is a 4th table called DocsMaster that has (amongst others) columns called Department (matches the unique ID field in DocsDept), Category (same for DocsCat) and SubCategory (same for DocsSubCat).
I have written a page (ASP) that builds a sort of map with all the departments, categories and subcategories. To do this I used the following query:
SELECT DocsDeptID, DocsDept.DocsDept, DocsCat.DocsCatID, DocsCat.DocsCat, DocsSubCat.DocsSubCatID, DocsSubCat
FROM (DocsDept
LEFT JOIN DocsCat ON DocsDept.DocsDeptID=DocsCat.DocsDept)
LEFT JOIN DocsSubCat ON DocsCat.DocsCatID=DocsSubCat.DocsCat
ORDER BY DocsCat.DocsCat ASC, DocsSubCat.DocsSubCat ASC
Is there anyway of counting the number of records in my DocsMaster table that have the particular department, category and subcategory for each row in the recordset?
Thanks very much
Ed
I have three tables called DocsDept, DocsCat and DocsSubCat. These three tables each have a uniqueID column and a text column.
There is a 4th table called DocsMaster that has (amongst others) columns called Department (matches the unique ID field in DocsDept), Category (same for DocsCat) and SubCategory (same for DocsSubCat).
I have written a page (ASP) that builds a sort of map with all the departments, categories and subcategories. To do this I used the following query:
SELECT DocsDeptID, DocsDept.DocsDept, DocsCat.DocsCatID, DocsCat.DocsCat, DocsSubCat.DocsSubCatID, DocsSubCat
FROM (DocsDept
LEFT JOIN DocsCat ON DocsDept.DocsDeptID=DocsCat.DocsDept)
LEFT JOIN DocsSubCat ON DocsCat.DocsCatID=DocsSubCat.DocsCat
ORDER BY DocsCat.DocsCat ASC, DocsSubCat.DocsSubCat ASC
Is there anyway of counting the number of records in my DocsMaster table that have the particular department, category and subcategory for each row in the recordset?
Thanks very much
Ed