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"