I need to verify 3 things
1. the ID number is valid.
2. the AssociateID is valid
3 the AssociateID gose the the correct ID
I have two tables
table 1. just has 2 columns with
ID AssociateID
1 11
1 12
1 13
2 14
3 15
3 16
Table 2. users with ID and the AssociateID they submit for time.
then the users are submitting time to the ID
User ID AssociateID
A 1 11
A 2 14
B 3 15
C 1 16 ' < this is a bad record in other words 16 does not go with ID 1, it goes with ID 3.
Is there a way to make a one line SQL statement to show any of the above 3 criteria are not met and then show which user faulted?
BTW we are working on a new form which won't allow users to pick ID and AssociateID that do not match, we are just not there yet.
I have this but it only checks ID's
1. the ID number is valid.
2. the AssociateID is valid
3 the AssociateID gose the the correct ID
I have two tables
table 1. just has 2 columns with
ID AssociateID
1 11
1 12
1 13
2 14
3 15
3 16
Table 2. users with ID and the AssociateID they submit for time.
then the users are submitting time to the ID
User ID AssociateID
A 1 11
A 2 14
B 3 15
C 1 16 ' < this is a bad record in other words 16 does not go with ID 1, it goes with ID 3.
Is there a way to make a one line SQL statement to show any of the above 3 criteria are not met and then show which user faulted?
BTW we are working on a new form which won't allow users to pick ID and AssociateID that do not match, we are just not there yet.
I have this but it only checks ID's
Code:
SELECT ExportExcelSheet1.SPMID, ExportExcelSheet1.CostTracker
FROM ExportExcelSheet1 LEFT JOIN SPMID ON ExportExcelSheet1.[SPMID] = SPMID.[smpid]
WHERE (((SPMID.smpid) Is Null));
[\code]
TIA
DougP