|
----- Original Message ----- From: "Smith, Mike" <Mike_Smith@RGCResources.com> To: <midrange-l@midrange.com> Sent: Friday, February 01, 2002 10:16 AM Subject: another can this be done with sql > select * from SOFILE,ACCTFILE where soact = acctact and sostat not in ('Y', > 'C') and acctstat not in ('AC', 'PN') and sotype in('PEDLV', 'PDLV') > this works fine. > > but i've been tasked with trying to make it more flexible. ie status codes > change etc. So i created a file that has the possible combinations of > Sostat, acctstat, and sotype(maybe i should have 3 files) ie Y,AC,PEDLV > Y,PN,PEDLV > can i do this the way i've set this up, if so how? Ok, I have to assume some things about your process: >From your note, you said "possible combinations" so I have to assume that you are completing a three file join now, not trying to implement the "not in (" selections. so, it should work with the following form: select * from sofile s join acctfile on soact = acctact a join codefile c on s.sostat = c.stat and a.acctstat = c.acctstat and s.sotype = c.sotype That last statement says "select records based on the codes all matching some combination in the third file". As for using three separate files in place of the third, the join would not work the same. Three separate files would have the effect of "oring" the join logic, not "anding" it. =========================================================== R. Bruce Hoffman, Jr. -- IBM Certified Specialist - iSeries Administrator -- IBM Certified Specialist - RPG IV Developer "Suppose you were an idiot... And suppose you were a member of Congress... But I repeat myself." - Mark Twain
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.