on 05-27-2015 7:40 PM
Buenas tardes
Se puede generar algo parecido pero nunca igual de manera nativa con la siguiente query, asignala como busqueda en el campo de la OV.
declare @p1 nvarchar(20),@p2 nvarchar(20),@p3 nvarchar(20),@p4 nvarchar(20)
set @p1=isnull(/*select A.ItemCode from OITM A where A.ItemCode=*/'[%0]','')
set @p2=isnull(/*select A.ItemCode from OITM A where A.ItemCode=*/'[%1]','')
set @p3=isnull(/*select A.CardCode from OCRD A where A.CardType='S' and A.CardCode=*/'[%2]','')
set @p4=isnull(/*select A.CardCode from OCRD A where A.CardType='S' and A.CardCode=*/'[%3]','')
if @p1<>'' and @p2<>''
begin
select A.[ItemCode], A.[ItemName], A.[OnHand]
from [dbo].[OITM] A
where (A.[ItemCode] >= @p1 and A.[ItemCode]<= @p2)
--or (A.CardCode >= @p3 and A.CardCode <= @p4)
end
else if @p3 <> '' and @p4<>''
begin
select A.[ItemCode], A.[ItemName], A.[OnHand]
from [dbo].[OITM] A
where --(A.[ItemCode] >= @p1 and A.[ItemCode]<= @p2) or
(A.CardCode >= @p3 and A.CardCode <= @p4)
end
else
select A.[ItemCode], A.[ItemName], A.[OnHand]
from [dbo].[OITM] A
--where (A.[ItemCode] >= @p1 and A.[ItemCode]<= @p2) or
--(A.CardCode >= @p3 and A.CardCode <= @p4)
Saludos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
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.