on 07-30-2010 5:34 PM
I would like to display the Parameters in the Query results. Is it possible?
Here is the Query, it gives errors.
SELECT 'Searched for' as 'Search', '[%0' as 'Input', T1.ItemCode, T1.Dscription, T1.Quantity, T1.OpenQty, T1.ShipDate, T0.DocNum, T1.LineNum,T0.CardCode, T0.CardName,T1.WhsCode, T1.LineStatus, T1.PickStatus, T1.PickIdNo FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry WHERE (T1.Dscription Like '%[%0] %'
OR T1.Dscription LIKE '[%0]%'
OR T1.Dscription LIKE '%[%0]') and '[%0]' != '' and T1.LineStatus='[%1]'
Edited by: M. Jenkins on Jul 30, 2010 6:47 PM
Try this one:
declare @c nvarchar(100)
declare @s char(1)
/*select T.Item from rdr1 t
where T.Dscription Like '%[%0]%' and T.LineStatus='[%1]'*/
set @c='[%0]'
set @s='[%1]'
SELECT 'Searched for' as 'Search',@c as Input, T1.ItemCode, T1.Dscription,
T1.Quantity, T1.OpenQty, T1.ShipDate,
T0.DocNum, T1.LineNum,T0.CardCode, T0.CardName,
T1.WhsCode, T1.LineStatus, T1.PickStatus, T1.PickIdNo
FROM ORDR T0
INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T1.Dscription Like '%'+@c+'%' and @c != '' and T1.LineStatus= @s
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your condition is actually equivalent to:
WHERE T1.Dscription Like '%[%0\] %' and '[%0\]' != '' and T1.LineStatus='[%1\]'
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 |
---|---|
99 | |
9 | |
9 | |
5 | |
4 | |
3 | |
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.