| re: Results returns from stored procedures
Hi Steve
Thanks for replying - its taken days for the problem to replicate itself.
When it finally I did I bought it home to my machine, where the problem
existed. I made some cosmetic changes to the code (column order and white
space) and the problem went away. I'm not holding out for an answer, given
my lack of information, but posting it here in case someone else has a
similar issue.
The other clue might be that this file is worked on both by Access 2002
and 2000 and shuffled between the two.
Here's the latest example
---------------------------
Alter PROCEDURE LoadProductByEvent
(
@VEHICLE nvarchar(12),
@Dt datetime,
@Seq int,
@Seq_load int
)
AS
SET NOCOUNT ON
SELECT dbo.ScheduledEvent.Id_Vehicle,
dbo.ScheduledEvent.Dt_,
dbo.ScheduledEvent.Sequence_,
dbo.ScheduledMovement_Product.Sequence_Load,
dbo.ScheduledMovement_Product.Id_Product,
dbo.ScheduledMovement_Product.id,
dbo.ScheduledMovement_Product.palletequiv_qty_prod uct,
dbo.ScheduledMovement_Product.qty_product
INTO #TMP1
FROM dbo.ScheduledEvent INNER JOIN
dbo.ScheduledMovement_Product ON dbo.ScheduledEvent.id =
dbo.ScheduledMovement_Product.Id_ScheduledEvent
WHERE (dbo.ScheduledEvent.Id_Vehicle = @Vehicle) AND
(dbo.ScheduledEvent.Dt_ < @Dt) OR
(dbo.ScheduledEvent.Id_Vehicle = @Vehicle) AND
(dbo.ScheduledEvent.Dt_ = @Dt) AND
(dbo.ScheduledEvent.Sequence_ < @Seq) OR
(dbo.ScheduledEvent.Id_Vehicle = @Vehicle) AND
(dbo.ScheduledEvent.Dt_ = @Dt) AND
(dbo.ScheduledEvent.Sequence_ = @Seq) AND
(dbo.ScheduledMovement_Product.Sequence_Load < @Seq_load)
SELECT id_product,sum(palletequiv_qty_product) as load_product,
sum(qty_product) as load_qty_product FROM #TMP1
GROUP BY
id_product
HAVING sum(palletequiv_qty_product) >0
__________________________ |