I'm an intermediate level sql user, which means I can maintain a server and build various level queries but I'm not expert level. I'll explain my issue below and hopefully someone can point me in the right direction. I've googled and searched but can't find exactly what I'm looking for. I don't think the Sunbelt SQL list is still operational either, or I would have asked there.
I have a Table I'm trying to do a select on. I have multiple fields I'm interested in but there are specific criteria I want. SELECT INVHH.HH_ORD, INVHH.HH_NME,MNBDD.BD_GLSA FROM INVHH JOIN MNBDD ON MNBDD.BD_TID = INVHH.HH_TID WHERE MNBDD.BD_GLSA IN (here's my problem) HH_ORD is really what I'm looking for but there will be many duplicates since it's an ORDER and it will have many line items on that ORDER. The HH_ORD lines I want to keep are only the ones that have BD_GLSA = '11000' when the BD_GLSA is LIKE '3%' and '4%' but NEVER if it has one LIKE '9%' So there can be 10 lines of the same HH_ORD with BD_GLSA = '11000' but if there isn't a '3%' or '4%' I don't want it and even if it has them but also has '9%' I definitely don't want the results. HH_ORD BD_GLSA 1 11000 1 11000 1 34231 1 42324 I want all of these results for ORDER 1 because of the BD_GLSA column. HH_ORD BD_GLSA 2 11000 2 11000 2 34231 2 40000 2 98000 I don't want these results for ORDER 2 because there's a 9% in the BD_GLSA column. I hope this made sense. J --------------------------------------- Jason Morris MJMC, Inc. [email protected] P: 708-225-2350 F: 708-943-9015 ------------------------------------------------------------------------------------------ The pages accompanying this email transmission contain information from MJMC, Inc., which is confidential and/or privileged. The information is to be for the use of the individual or entity named on this cover sheet. If you are not the intended recipient, you are hereby notified that any disclosure, dissemination, distribution, or copying of this communication is strictly prohibited. If you received this transmission in error, please immediately notify us by telephone so that we can arrange for the retrieval of the original document. ~ Finally, powerful endpoint security that ISN'T a resource hog! ~ ~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~
