Jim - thanks for your email. I decided to go back a bit and try just looking for SOW in the filename - here is the SQL Statement:
SELECT COUNT (Request_ID) FROM dbo.IPVPN_IPACT_Overview WHERE (Request_ID = '$Request ID$') AND ((PATINDEX('%SOW%',UPPER(Scope_of_Work)) > 0) ) It is returning 0 when I add the attachment and 1 when I delete the attachment. Suggestions? Ty -----Original Message----- From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] On Behalf Of Jim Ashton Sent: Wednesday, December 06, 2006 10:02 AM To: arslist@ARSLIST.ORG Subject: Re: Fwd: Question: SQL I think you may need one more set of brackets. It appears that the query always returns 1 because Request_ID = '$Request ID$' is always true and at least one of the OR conditions is true somewhere in the IPVPN_IPACT_Overview table. Put another set of brackets around everything following the AND (as shown below) which will result in both that particular request and at least one of the OR conditions needing to be true to return a value. SELECT COUNT (Request_ID) FROM dbo.IPVPN_IPACT_Overview WHERE (Request_ID = '$Request ID$') AND ( ((PATINDEX('%SOW%', UPPER(Scope_of_Work)) > 0) OR (PATINDEX('%IPDP%', UPPER(Scope_of_Work)) > 0) OR (PATINDEX('%MACD%', UPPER(Scope_of_Work)) > 0)) ) Cheers, Jim. ____________________________________________________________________________ ___ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are" _______________________________________________________________________________ UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the Answers Are"