sql-server - 从字符串转换日期和/或时间转换失败
问题描述
declare @orderwhere varchar(5000)
declare @Pdate DateTime
set @orderwhere = 'Product.ProductID = 1 And Product.ProductDate=' + @Pdate
exec('select Product.ProductID
from Product
where ' + @orderwhere)
我收到这些错误:
消息 241,级别 16,状态 1,第 4 行
从字符串转换日期和/或时间时转换失败。
解决方案
推荐阅读
- css - 在html分离中实现message和textarea/input布局
- javascript - 如何在 Jquery 中使用 .click() 单击超链接?
- django - 我正在尝试从我的 django 项目中的另一个应用程序导入模型产品
- c# - C# .net Core 捕获自定义异常
- c - 在 c 宏中执行算术运算
- ios - 当scrollview快速滚动时如何滚动collectionView?
- math - 查找给定(sympy)行列表的中心线
- php - 如何插入多选的新值
- android - 生成 APK 构建时出错并尝试从设备即时应用程序运行它
- elasticsearch - 在elasticsearch中加入文档