Hi,
I have the following stored proc:
CREATE PROCEDURE dbo.sp_Stock_Report_WH1
@DayOfStockTake1 datetime,
@DayOfStockTake2 datetime
AS
select * from stocktran
where stx_warehouse = 'WH1'
and
stx_document >
(select max(stx_document) from stocktran
where stx_trandate = @DayOfStockTake1)
and
stx_document <=
(select max(stx_document) from stocktran
where stx_trandate = @DayOfStockTake2)
When I call it with the following, I get no data:
sp_Stock_Report_WH1 '2003-04-04 00:00:00.000','2003-04-11 00:00:00.000'
I know there is data in the table that should appear. The syntax checks out okay in query analyser. Does anyone know if the above should be okay?
Many thanks for your help,
Tony.
I have the following stored proc:
CREATE PROCEDURE dbo.sp_Stock_Report_WH1
@DayOfStockTake1 datetime,
@DayOfStockTake2 datetime
AS
select * from stocktran
where stx_warehouse = 'WH1'
and
stx_document >
(select max(stx_document) from stocktran
where stx_trandate = @DayOfStockTake1)
and
stx_document <=
(select max(stx_document) from stocktran
where stx_trandate = @DayOfStockTake2)
When I call it with the following, I get no data:
sp_Stock_Report_WH1 '2003-04-04 00:00:00.000','2003-04-11 00:00:00.000'
I know there is data in the table that should appear. The syntax checks out okay in query analyser. Does anyone know if the above should be okay?
Many thanks for your help,
Tony.