不确定这个日期表达式的作用
not sure what this date expression does
我继承了一份包含以下代码行的报告:
ftb2.gwy_strt_tmsp >cast((current_date -extract(day from current_date)) as timestamp(6))))
此报告在每月的第一天运行。我不明白所使用的日期标准。此代码是否意味着它从当前日期减去该月的第几天以查找日期?非常感谢关于这行代码正在做什么的任何解释。谢谢帮助......
表达式 extract(day from current_date)
获取当前日期。
从当前日期中减去它得到上个月的最后一天。
比较 >
表示 "any date matches that is after the last day of the previous month"。假设 gwy_strt_tmsp
没有时间成分,并且没有未来的时间戳,那么这是 shorthand for "get me records in the current month".
如果gwy_start_tmsp
有时间部分,那么它也会获取上个月最后一天的记录。
我继承了一份包含以下代码行的报告:
ftb2.gwy_strt_tmsp >cast((current_date -extract(day from current_date)) as timestamp(6))))
此报告在每月的第一天运行。我不明白所使用的日期标准。此代码是否意味着它从当前日期减去该月的第几天以查找日期?非常感谢关于这行代码正在做什么的任何解释。谢谢帮助......
表达式 extract(day from current_date)
获取当前日期。
从当前日期中减去它得到上个月的最后一天。
比较 >
表示 "any date matches that is after the last day of the previous month"。假设 gwy_strt_tmsp
没有时间成分,并且没有未来的时间戳,那么这是 shorthand for "get me records in the current month".
如果gwy_start_tmsp
有时间部分,那么它也会获取上个月最后一天的记录。