简体   繁体   English

在SSIS条件拆分中测试零日期时间

[英]Test for zero datetime in SSIS Conditional Split

A value coming back from a DB2 query passes a zero date as 0001-01-01 00:00:00.000000 and I am having a problem testing for this value in a Conditional Split condition. 从DB2查询返回的值将零日期作为0001-01-01 00:00:00.000000传递,我在条件拆分条件下对该值进行测试时遇到问题。 I tried a few different things but either they stay red or cause an error when run. 我尝试了一些其他操作,但是它们还是保持红色或在运行时导致错误。 I even tried testing for the date being less than the SQL start date. 我什至尝试测试小于SQL开始日期的日期。 Neither of these work. 这些都不起作用。

(DT_Date)DRIVER_TERMDATE < (DT_DATE)"1753-1-1"

DRIVER_TERMDATE != "0001-01-01 00:00:00.000000"

The minimum date for the DT_DATE data type is 1899-12-30, which is after that date and trying to convert it to this data type will cause an error. DT_DATE数据类型的最小日期是1899-12-30,该日期在该日期之后,尝试将其转换为该数据类型将导致错误。 If you're importing the DRIVER_TERMDATE as text, trying adding a condition for this string, for example 如果要以文本形式导入DRIVER_TERMDATE ,请尝试为此字符串添加条件,例如

DRIVER_TERMDATE == "0001-01-01 00:00:00.000000"

However it looks like you already tried checking to see if DRIVER_TERMDATE is not equal to this value, so see if trailing zeros are being removed during from the text during execution by right-clicking the output from the DB2 source, selecting Enable Data Viewer, and examining the data when the package runs. 但是,您似乎已经尝试检查DRIVER_TERMDATE是否不等于该值,因此通过右键单击DB2源的输出,选择Enable Data Viewer,然后查看执行期间是否从文本中删除尾随零。程序包运行时检查数据。 Once you've confirmed the exact string that's being sent in, you can add a condition for this. 确认要发送的确切字符串后,您可以为此添加一个条件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM