openedge - 如何使用progress 4gl计算昨天的记录和今天的记录?
问题描述
我写了一个程序,我需要用今天的记录来计算昨天的记录(从 12:00 AM 到 05:00 AM)
for each womf_worder of sfcf_au_ship where
womf_worder.word_production_status EQ "B" and
womf_worder.word_build_date EQ today - 1 and
womf_worder.word_build_time GE tt_shift.shft_start_hour and
womf_worder.word_build_time LE tt_shift.shft_stop_hour
no-lock:
assign i = i + 1.
end.
但问题是我只需要用今天的记录计算那些提到的时间(12:00 AM 到 05:00 AM)的订单。你能帮助这个案子吗?
解决方案
如果您知道您的数据中没有“未来”日期,则可以使用以下内容:
for each womf_worder of sfcf_au_ship where
womf_worder.word_production_status EQ "B" and
womf_worder.word_build_date GE today - 1 and
womf_worder.word_build_time GE tt_shift.shft_start_hour and
womf_worder.word_build_time LE tt_shift.shft_stop_hour
no-lock:
assign i = i + 1.
end.
如果您不熟悉您正在使用的数据或希望它更便携:
for each womf_worder of sfcf_au_ship where
womf_worder.word_production_status EQ "B" and
womf_worder.word_build_time GE tt_shift.shft_start_hour and
womf_worder.word_build_time LE tt_shift.shft_stop_hour and
( womf_worder.word_build_date eq today - 1 or
womf_worder.word_build_date eq today )
no-lock:
assign i = i + 1.
end.
推荐阅读
- android - 将工作 Web 应用程序转变为适用于 Android 的本机 Ionic 应用程序时出现 CORS 问题
- python - 如何根据两个数字之间的索引值从熊猫df中选择行
- javascript - 监视组件内部 jQuery 完成的变量更改
- phpmyadmin - 为什么我的 phpmyadmin 正在下载一个名为“下载”的文件?
- android - 是否有任何选项可以在具有不同 appbundles/appId 的多个应用程序之间共享钥匙串数据?
- reactjs - Formik 在 React 中不显示错误
- css - 为什么是背景色:背景;Chrome上的紫色?
- sql-server - 如何使用 EF Core 在我的应用程序中显示来自 3 个不同表的数据
- docker - Spark 在单台计算机上以独立模式运行:是否值得通过 docker 容器(或其他方式)将其拆分为 master 和 worker?
- regex - Powershell:没有应用正则表达式事实上服务器测试说它是正确的