Stored procedures 关键字“convert”附近的语法不正确
我有程序Stored procedures 关键字“convert”附近的语法不正确,stored-procedures,sybase,Stored Procedures,Sybase,我有程序 create procedure dbo.updateView(@cobdate datetime) as begin Update hir_view set ValidTo=@cobdate where HierarchyId in ( select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in ( sele
create procedure dbo.updateView(@cobdate datetime)
as
begin
Update hir_view set ValidTo=@cobdate where HierarchyId in (
select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
select HierarchyId from hir_organisation where ValidTo>getDate()
)
) and ValidTo>getDate()
end
go
我得到了错误声明
查找错误-Msg 156,级别15,状态34,服务器DSLNPHX02,第18行-Sybase数据库错误:关键字“convert”附近的语法不正确
我不确定哪里出错了语法正确,您是否尝试过像这样运行update命令
convert(dateTime,'20160209')
Update hir_view set ValidTo=convert(dateTime,'20160209') where HierarchyId in (
select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
select HierarchyId from hir_organisation where ValidTo>getDate()
)
) and ValidTo>getDate()
convert(dateTime,'20160209')
Update hir_view set ValidTo=convert(dateTime,'20160209') where HierarchyId in (
select distinct HierarchyId from hir_organisation where ValidTo<getDate() and HierarchyId not in (
select HierarchyId from hir_organisation where ValidTo>getDate()
)
) and ValidTo>getDate()