我有这样的存储过程:
create PROCEDURE [dbo].[Test1]
@startdate datetime(100),
@enddate datetime(100)
set date1 = CONVERT(datetime, @startdate + ' 00:01:00', 120)
set date2 = CONVERT(datetime, @enddate + ' 00:23:59', 120)
as
begin
select t.PlateNo
from Transaction_tbl t
WHERE dtime between @date1 + ' 00.01.00.00'
AND @date2 + ' 23:59.59.00'
end
执行此操作时收到两条错误消息
关键字“set”附近的语法不正确。
必须声明标量变量
@date1