on 04-15-2009 6:46 PM
I have a query that contains a text UDF, where I need to search for a string that the user enters, see example below:
SELECT t0.docnum, t0.cardname, t0.cntctcode, t0.docdate, t0.u_salescomments, t0.u_generalnotes, t0.u_salesrepcodes, t1.dscription, t1.price, t1.u_custpartno, t1.u_salescomments FROM OQUT t0, QUT1 t1 WHERE t0.docentry = t1.docentry AND t0.u_cr1flag = 'QUOTE' AND t1.dscription = [%0] OR t1.u_custpartno = [%1] OR t0.cardname = [%2] OR t0.cntctcode = [%3] OR t0.u_salesrepcodes = [%4] OR CONTAINS(t0.u_salescomments, '%%[%5]%%')
The issue is the last variable for u_salescomments, where I want to search for a user entered string in the text contained within this field.
Thanks
Try this one:
SELECT t0.docnum, t0.cardname, t0.cntctcode, t0.docdate, t0.u_salescomments, t0.u_generalnotes,
t0.u_salesrepcodes, t1.dscription, t1.price, t1.u_custpartno, t1.u_salescomments
FROM dbo.OQUT t0
INNER JOIN dbo.QUT1 t1 ON t0.docentry = t1.docentry
WHERE t0.u_cr1flag = 'QUOTE' AND t1.dscription = [%0] OR t1.u_custpartno = [%1] OR t0.cardname = [%2]
OR t0.cntctcode = [%3] OR t0.u_salesrepcodes = [%4] OR t0.u_salescomments like '%[%5]%'
Thanks
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.