![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Table accountNo PK subType subType domain is (a,b,c,d,e). Customers can have a subscription of any combination of types. I want to find all those that only have a subscription of type 'a'. It is possible that some people have a subscription to types a&b, a&c, a&d, a&e, b&c etc. I am using the following query: SELECT t1.subType, t1.accountNo FROM <table> as t1 INNER JOIN <table> as t2 ON t1.accountNo = t2.accountNo WHERE t1.subType = 'a' AND t2.subType Not In ("b","c","d","e"); However this doesn't give me what I need. Thank you for your help. Best wishes, Simon. |
#3
| |||
| |||
|
|
thisisjustaspamdump (AT) hotmail (DOT) com (Simon Long) wrote in message news:<40118e41.0407070625.12384808 (AT) posting (DOT) google.com>... Table accountNo PK subType subType domain is (a,b,c,d,e). Customers can have a subscription of any combination of types. I want to find all those that only have a subscription of type 'a'. It is possible that some people have a subscription to types a&b, a&c, a&d, a&e, b&c etc. I am using the following query: SELECT t1.subType, t1.accountNo FROM <table> as t1 INNER JOIN <table> as t2 ON t1.accountNo = t2.accountNo WHERE t1.subType = 'a' AND t2.subType Not In ("b","c","d","e"); However this doesn't give me what I need. Thank you for your help. Best wishes, Simon. Hello Simon, I have a question. Are the letter combinations in one field? If so, put this into the criteria of your field: [Enter Letter Combination] This will allow you to type the letter a and only get the records that have it in the field. If you type ab you'll get those records, etc. Regards, Ray |
#4
| |||
| |||
|
|
Table accountNo PK subType subType domain is (a,b,c,d,e). Customers can have a subscription of any combination of types. I want to find all those that only have a subscription of type 'a'. It is possible that some people have a subscription to types a&b, a&c, a&d, a&e, b&c etc. I am using the following query: SELECT t1.subType, t1.accountNo FROM <table> as t1 INNER JOIN <table> as t2 ON t1.accountNo = t2.accountNo WHERE t1.subType = 'a' AND t2.subType Not In ("b","c","d","e"); Hi Ray, Thanks for the reply. Unfortunately they are not in the form of a combination. For example: accountNo subType 1 a 1 c 2 d 3 e 1 e 4 a 5 c etc. |
#5
| |||
| |||
|
|
raycait (AT) excite (DOT) com (Ray) wrote in message news:<20ba9f4a.0407080837.4a677f63 (AT) posting (DOT) google.com>... thisisjustaspamdump (AT) hotmail (DOT) com (Simon Long) wrote in message news:<40118e41.0407070625.12384808 (AT) posting (DOT) google.com>... Table accountNo PK subType subType domain is (a,b,c,d,e). Customers can have a subscription of any combination of types. I want to find all those that only have a subscription of type 'a'. It is possible that some people have a subscription to types a&b, a&c, a&d, a&e, b&c etc. I am using the following query: SELECT t1.subType, t1.accountNo FROM <table> as t1 INNER JOIN <table> as t2 ON t1.accountNo = t2.accountNo WHERE t1.subType = 'a' AND t2.subType Not In ("b","c","d","e"); However this doesn't give me what I need. Thank you for your help. Best wishes, Simon. Hello Simon, I have a question. Are the letter combinations in one field? If so, put this into the criteria of your field: [Enter Letter Combination] This will allow you to type the letter a and only get the records that have it in the field. If you type ab you'll get those records, etc. Regards, Ray Hi Ray, Thanks for the reply. Unfortunately they are not in the form of a combination. For example: accountNo subType 1 a 1 c 2 d 3 e 1 e 4 a 5 c etc. I need to find all the accountNos where the subType is 'a' AND 'c'. In this instance '1'. Thanks for your help. Best wishes, Simon. |
![]() |
| Thread Tools | |
| Display Modes | |
| |