good afternoon all
I'm doing the following query where, I am taking a WHILE returning me the lines of quantity
buenas tardes foro estoy realizando la siguiente consulta donde esto ocupando un WHILE que me regresa los renglones según las cantidades
WHILE @i <= (select B.Quantity/B.PackQty from ORDR A INNER JOIN RDR1 B on A.DocEntry = B.DocEntry where A.DocNum = 3828)
BEGIN;
IF (@i%1000!=0)
PRINT @i
SET @i=@i+1;
END;
all goes well only when my order is the one line, if is two line mark error. can I solve this situation?
ERROR
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.