A
Antonio
How can I convert a query into a VB statement?
I have a query that looks into a specific field in all the
records and returns all the customers that contains that
specific criteria.
The SQL statement would be:
SELECT CustomerDB.CompanyName, CustomerDB.ContactName,
CustomerDB.City, CustomerDB.State, CustomerDB.Phone,
CustomerDB.[E-mail Address]
FROM CustomerDB
WHERE (((CustomerDB.SubscriptionCode1)="O1025")) OR
(((CustomerDB.SubscriptionCode2)="O1025")) OR
(((CustomerDB.SubscriptionCode3)="O1025")) OR
(((CustomerDB.SubscriptionCode4)="O1025")) OR
(((CustomerDB.SubscriptionCode5)="O1025")) OR
(((CustomerDB.SubscriptionCode6)="O1025")) OR
(((CustomerDB.SubscriptionCode7)="O1025")) OR
(((CustomerDB.SubscriptionCode8)="O1025")) OR
(((CustomerDB.SubscriptionCode9)="O1025")) OR
(((CustomerDB.SubscriptionCode10)="O1025")) OR
(((CustomerDB.SubscriptionCode11)="O1025")) OR
(((CustomerDB.SubscriptionCode12)="O1025")) OR
(((CustomerDB.SubscriptionCode13)="O1025")) OR
(((CustomerDB.SubscriptionCode14)="O1025")) OR
(((CustomerDB.SubscriptionCode15)="O1025")) OR
(((CustomerDB.SubscriptionCode16)="O1025")) OR
(((CustomerDB.SubscriptionCode17)="O1025")) OR
(((CustomerDB.SubscriptionCode18)="O1025")) OR
(((CustomerDB.SubscriptionCode19)="O1025")) OR
(((CustomerDB.SubscriptionCode20)="O1025")) OR
(((CustomerDB.SubscriptionCode21)="O1025")) OR
(((CustomerDB.SubscriptionCode22)="O1025")) OR
(((CustomerDB.SubscriptionCode23)="O1025")) OR
(((CustomerDB.SubscriptionCode24)="O1025")) OR
(((CustomerDB.SubscriptionCode25)="O1025")) OR
(((CustomerDB.SubscriptionCode26)="O1025")) OR
(((CustomerDB.SubscriptionCode27)="O1025")) OR
(((CustomerDB.SubscriptionCode28)="O1025")) OR
(((CustomerDB.SubscriptionCode29)="O1025")) OR
(((CustomerDB.SubscriptionCode30)="O1025")) OR
(((CustomerDB.SubscriptionCode31)="O1025")) OR
(((CustomerDB.SubscriptionCode32)="O1025")) OR
(((CustomerDB.SubscriptionCode33)="O1025")) OR
(((CustomerDB.SubscriptionCode34)="O1025"))
GROUP BY CustomerDB.CompanyName, CustomerDB.ContactName,
CustomerDB.City, CustomerDB.State, CustomerDB.Phone,
CustomerDB.[E-mail Address]
HAVING (((CustomerDB.CompanyName) Is Not Null))
ORDER BY CustomerDB.CompanyName;
I have a query that looks into a specific field in all the
records and returns all the customers that contains that
specific criteria.
The SQL statement would be:
SELECT CustomerDB.CompanyName, CustomerDB.ContactName,
CustomerDB.City, CustomerDB.State, CustomerDB.Phone,
CustomerDB.[E-mail Address]
FROM CustomerDB
WHERE (((CustomerDB.SubscriptionCode1)="O1025")) OR
(((CustomerDB.SubscriptionCode2)="O1025")) OR
(((CustomerDB.SubscriptionCode3)="O1025")) OR
(((CustomerDB.SubscriptionCode4)="O1025")) OR
(((CustomerDB.SubscriptionCode5)="O1025")) OR
(((CustomerDB.SubscriptionCode6)="O1025")) OR
(((CustomerDB.SubscriptionCode7)="O1025")) OR
(((CustomerDB.SubscriptionCode8)="O1025")) OR
(((CustomerDB.SubscriptionCode9)="O1025")) OR
(((CustomerDB.SubscriptionCode10)="O1025")) OR
(((CustomerDB.SubscriptionCode11)="O1025")) OR
(((CustomerDB.SubscriptionCode12)="O1025")) OR
(((CustomerDB.SubscriptionCode13)="O1025")) OR
(((CustomerDB.SubscriptionCode14)="O1025")) OR
(((CustomerDB.SubscriptionCode15)="O1025")) OR
(((CustomerDB.SubscriptionCode16)="O1025")) OR
(((CustomerDB.SubscriptionCode17)="O1025")) OR
(((CustomerDB.SubscriptionCode18)="O1025")) OR
(((CustomerDB.SubscriptionCode19)="O1025")) OR
(((CustomerDB.SubscriptionCode20)="O1025")) OR
(((CustomerDB.SubscriptionCode21)="O1025")) OR
(((CustomerDB.SubscriptionCode22)="O1025")) OR
(((CustomerDB.SubscriptionCode23)="O1025")) OR
(((CustomerDB.SubscriptionCode24)="O1025")) OR
(((CustomerDB.SubscriptionCode25)="O1025")) OR
(((CustomerDB.SubscriptionCode26)="O1025")) OR
(((CustomerDB.SubscriptionCode27)="O1025")) OR
(((CustomerDB.SubscriptionCode28)="O1025")) OR
(((CustomerDB.SubscriptionCode29)="O1025")) OR
(((CustomerDB.SubscriptionCode30)="O1025")) OR
(((CustomerDB.SubscriptionCode31)="O1025")) OR
(((CustomerDB.SubscriptionCode32)="O1025")) OR
(((CustomerDB.SubscriptionCode33)="O1025")) OR
(((CustomerDB.SubscriptionCode34)="O1025"))
GROUP BY CustomerDB.CompanyName, CustomerDB.ContactName,
CustomerDB.City, CustomerDB.State, CustomerDB.Phone,
CustomerDB.[E-mail Address]
HAVING (((CustomerDB.CompanyName) Is Not Null))
ORDER BY CustomerDB.CompanyName;