SSIS 表达式生成器我有转换错误,无法将string
转换为datetime
"SELECT *
FROM table Where OperatingDayDate>='"+@[User::MaxOperatingDayDateTime]
错误:无法将字符串转换为DATETIME
MaxOperatingDayDateTime是SSIS中的变量DATETIME OperatingDayDate是DATE类型
答案 0 :(得分:1)
您必须转换变量数据类型:
"SELECT *
FROM table Where OperatingDayDate>='"+ (DT_WSTR,50)@[User::MaxOperatingDayDateTime] + "'"
未提及的一件事,如果您在OLEDB Source中使用SQL命令,则可以使用参数化查询:
SELECT * FROM table Where OperatingDayDate >= ?