Declare @StartDate Char(10), @FinishDate Char(10), @sup_code Int
Select @StartDate = '2000-03-01', @FinishDate = '2010-03-31', @sup_code = 34
Select @StartDate = :StartDate, @FinishDate = :FinishDate, @sup_code = :sup_code
Select paym_code,
sup_bzname,
paym_date,
paym_m1,
paym_m2,
paym_m3,
paym_m4,
paym_d1,
paym_d2,
paym_d3,
paym_d4,
(paym_m1+paym_m2+paym_m3+paym_m4+paym_d1+paym_d2+paym_d3+paym_d4) As payms,
paym_remark,
pur_code,
(Select detl_codename From usercodedetail Where mast_code = 30 and detl_code = paym_bankcode) paym_bankname
from payment, supplier, employee
where paym_emp = code
and paym_supcode = sup_code
and (sup_code = @sup_code or @sup_code = -1)
and paym_date between convert(datetime, @StartDate) and dateadd(second, -1, dateadd(day, 1, convert(datetime, @FinishDate)))
and paym_status = 1
order by paym_date desc, paym_code desc, paym_supcode asc
메시지 102, 수준 15, 상태 1, 줄 3
':' 근처의 구문이 잘못되었습니다.
ms-sql2012쓰고있구요..
완전 개초보입니다.
:가 잘못됐다는데 뭘변경해줘야하나요...ㅠㅠ
Select @StartDate = :StartDate <-- : 요런 구문은 없을텐데요..