G
Guest
Ok,
Sorry for the length of this message - rather give all the
details so it is clear to understand
Table Structure : ------------------------------------------
FileProduct
===========
ID AutoNumber -> Unique Key (Long Integer)
FileProduct Text -> Description of product.
FileDetails
===========
ID AutoNumber -> Unique Key (Long Integer)
ProductID Text -> Relational Link into the FileProduct Table
above.
Filename Text -> Name of the file.
Version Text -> Version Details of File.
PCDetails
=========
ID AutoNumber -> Unique Key (Long Integer)
PCName Text -> Name of PC
FileName Text -> FileName found on PC.
Version Text -> Version Details.
Table Data (what is in each table):
FileProduct
===============
ID FileProduct
-- -----------
1 P1
File Details
===============
ID ProductID Filename Version
-- --------- -------- -------
1 1 F1.DAT 1
2 1 F1.DAT 2
3 1 F3.DAT 2
4 1 F4.DAT 2
PCDetails
=========
ID PCName FileName Version
-- ------ -------- -------
1 PC1 F1.DAT 2
2 PC1 F3.DAT 2
3 PC1 F4.DAT 2
4 PC2 F1.DAT 1
5 PC2 F3.DAT 2
6 PC2 F6.DAT 3
Ok now here is the problem. What I am trying to do with Access 2003 is work
out how to make a query that will return every PCName that has has the items
in the FileProduct.
Ok here is how I would like it processed
Any file with the same name would be joined by an OR condition.
So the logic would be.
If the PC record has (F1.DAT - Version 1 OR F1.DAT - Version 2) AND (F3.DAT
- Version 2)
and (F4.DAT - Version 2) then it would be a succesfull match and return PC1.
So as you can see files with the same name are ORed together and files with
different
names are ANDed together.
In the PC Details this would match rows 1,2 and 3. However, PC2 would not be
matched
because it does not have a match for F4.DAT.
Now a Product could have mulltiple files in it and there would be multiple
products.
So how do I do this with a Access 2003 Query? I figure this is possible with
some
magic SQL - but I can't figure it out.. I am hoping I don't have to resort
to some
complex Access basic routine. My instincts say this is possible with just a
SQL statement. (BTW: All my data is held in Access 2003 if that makes any
difference).
Any help greatly appreciated !!!
Thanks,
Ward.
Sorry for the length of this message - rather give all the
details so it is clear to understand
Table Structure : ------------------------------------------
FileProduct
===========
ID AutoNumber -> Unique Key (Long Integer)
FileProduct Text -> Description of product.
FileDetails
===========
ID AutoNumber -> Unique Key (Long Integer)
ProductID Text -> Relational Link into the FileProduct Table
above.
Filename Text -> Name of the file.
Version Text -> Version Details of File.
PCDetails
=========
ID AutoNumber -> Unique Key (Long Integer)
PCName Text -> Name of PC
FileName Text -> FileName found on PC.
Version Text -> Version Details.
Table Data (what is in each table):
FileProduct
===============
ID FileProduct
-- -----------
1 P1
File Details
===============
ID ProductID Filename Version
-- --------- -------- -------
1 1 F1.DAT 1
2 1 F1.DAT 2
3 1 F3.DAT 2
4 1 F4.DAT 2
PCDetails
=========
ID PCName FileName Version
-- ------ -------- -------
1 PC1 F1.DAT 2
2 PC1 F3.DAT 2
3 PC1 F4.DAT 2
4 PC2 F1.DAT 1
5 PC2 F3.DAT 2
6 PC2 F6.DAT 3
Ok now here is the problem. What I am trying to do with Access 2003 is work
out how to make a query that will return every PCName that has has the items
in the FileProduct.
Ok here is how I would like it processed
Any file with the same name would be joined by an OR condition.
So the logic would be.
If the PC record has (F1.DAT - Version 1 OR F1.DAT - Version 2) AND (F3.DAT
- Version 2)
and (F4.DAT - Version 2) then it would be a succesfull match and return PC1.
So as you can see files with the same name are ORed together and files with
different
names are ANDed together.
In the PC Details this would match rows 1,2 and 3. However, PC2 would not be
matched
because it does not have a match for F4.DAT.
Now a Product could have mulltiple files in it and there would be multiple
products.
So how do I do this with a Access 2003 Query? I figure this is possible with
some
magic SQL - but I can't figure it out.. I am hoping I don't have to resort
to some
complex Access basic routine. My instincts say this is possible with just a
SQL statement. (BTW: All my data is held in Access 2003 if that makes any
difference).
Any help greatly appreciated !!!
Thanks,
Ward.