带获取日期的 CASE 语句
CASE statement with get date
我收到一个日期为今天的文件,但有时它会在午夜过后发送给我,所以它会在明天 00:00 和 03:00 之间发送,案例陈述有用吗?如果可以的话,你能帮我写代码吗,因为我对这一切都不熟悉。我认为如果 case 语句在 00:00 和 03:00 之间通过,则需要 getdate -1.
我使用 SSIS 获取包以将 getdate() 作为变量读取,这就是它知道文件读取内容的方式。
感谢任何帮助
申请ssis,
execute sql task
将能够根据当前日期触发读取文件夹中的文件。
select case when getdate() between cast(getdate() as date) and dateadd(ss, 30, cast(cast(getdate() + 1 as date) as datetime)) then 1 else 0 en
d
我收到一个日期为今天的文件,但有时它会在午夜过后发送给我,所以它会在明天 00:00 和 03:00 之间发送,案例陈述有用吗?如果可以的话,你能帮我写代码吗,因为我对这一切都不熟悉。我认为如果 case 语句在 00:00 和 03:00 之间通过,则需要 getdate -1.
我使用 SSIS 获取包以将 getdate() 作为变量读取,这就是它知道文件读取内容的方式。 感谢任何帮助
申请ssis,
execute sql task
将能够根据当前日期触发读取文件夹中的文件。
select case when getdate() between cast(getdate() as date) and dateadd(ss, 30, cast(cast(getdate() + 1 as date) as datetime)) then 1 else 0 en
d