By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

Rewrite Query

P: 72
Hi,
is there a way to rewrite this code to make it short. The query won't run
because it max the # of characters allowed. sorry it's written in caps.
thanks in advance:
Expand|Select|Wrap|Line Numbers
  1. BASE ADMIN: IIf(CDPINC_ARIBD!IDACCTREV="5021-0PENSN-QTV" Or CDPINC_ARIBD!
  2. IDACCTREV="5021-0PENSN-SAV" Or CDPINC_ARIBD!IDACCTREV="5021-0PENSN-ANV" Or
  3. CDPINC_ARIBD!IDACCTREV="5021-0PENSN-RSA" Or CDPINC_ARIBD!IDACCTREV="5021-
  4. 0PENSN-PER" Or CDPINC_ARIBD!IDACCTREV="5021-0PENSN-DOC" Or CDPINC_ARIBD!
  5. IDACCTREV="5021-0PENSN-SDI" Or CDPINC_ARIBD!IDACCTREV="5021-0PENSN-SVC" Or
  6. CDPINC_ARIBD!IDACCTREV="5020-0PENSN-QTV" Or CDPINC_ARIBD!IDACCTREV="5020-
  7. 0PENSN-STQ" Or CDPINC_ARIBD!IDACCTREV="5020-0PENSN-MSC" Or CDPINC_ARIBD!
  8. IDACCTREV="5020-0PENSN-PER" Or CDPINC_ARIBD!IDACCTREV="5020-0PENSN-DOC" Or
  9. CDPINC_ARIBD!IDACCTREV="5020-0PENSN-SDI" Or CDPINC_ARIBD!IDACCTREV="5020-
  10. 0PENSN-SVC",CDPINC_ARIBD!AMTTXBL,0)
Apr 24 '08 #1
Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,494
Use the In() structure :
Expand|Select|Wrap|Line Numbers
  1. BASE ADMIN: IIf(CDPINC_ARIBD.IDACCTREV In('5021-0PENSN-QTV','5021-0PENSN-SAV','5021-0PENSN-ANV','5021-0PENSN-RSA','5021-0PENSN-PER','5021-0PENSN-DOC','5021-0PENSN-SDI','5021-0PENSN-SVC','5020-0PENSN-QTV','5020-0PENSN-STQ','5020-0PENSN-MSC','5020-0PENSN-PER','5020-0PENSN-DOC','5020-0PENSN-SDI','5020-0PENSN-SVC'),CDPINC_ARIBD.AMTTXBL,0)
Apr 25 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.