I use this sql to do some monthly processing.
My procedure loops through the table names strTBL
and updates the DEL field.
strSQL = “UPDATE [” & strTBL & “] SET [” & strTBL & “].DEL = ‘N’ ” & _
“WHERE ((([” & strTBL & “].MINORPAC) Like ‘BALEL-TF’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘ACVS-10’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘FBA*’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘BJOHA*’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘BHRTZ-TF’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘AHRBL-10’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘RAM*’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘LUCTE-10’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘ANOMO-EDI’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘COUNI-10’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘STEMP-10’ ” & _
“Or ([” & strTBL & “].MINORPAC) Like ‘SHEPC*’))”
If I get a new account this month, how can I add the new account to the end of the Where clause without doing it manually. Would an array work or somehow loop through a table with all the account names?
What would be the best way?
Scott
-
Building a SQL string (Access97/2k)
- This topic has 2 replies, 2 voices, and was last updated 22 years, 11 months ago.
AuthorViewing 0 reply threadsAuthorViewing 0 reply threads