我有选择和过滤数据的存储过程。例如 :
select CONVERT(nvarchar,[Date],120) , [FirstName] , [LastName]
FROM myDB
WHERE (@Date IS NULL OR @Date = '' OR [Date] = @Date)
(@FirstName IS NULL OR @FirstName = '' OR [FirstName] = @FirstName)
(@LastName IS NULL OR @LastName = '' OR [LastName] = @LastName)
当我按名字或/和姓氏过滤时,它可以工作,但是当我想按数据过滤时它不起作用,我认为可能存在转换问题?我喜欢执行:
exec myProc '2013-02-03','',''