sql-scripts - 不为空时从其他表更新表日期字段
问题描述
我想从同一个表中的一些记录(条目类型 = 1)更新表中为条目类型 = 4 提交的日期,但是得到一个无法在字段中插入空数据的错误。
UPDATE [Item Ledger Entry]
SET [Last Invoice Date] = (Select MAX([Posting Date])
from [Item Ledger Entry] ILE2
where ILE2.[Item No_] = ILE1.[Item No_] AND
ILE2.[Posting Date] <= ILE1.[Posting Date] AND
ILE2.[Entry Type] = 1 AND
ILE2.[Posting Date] is not null
)
FROM [Item Ledger Entry] ILE1
where ILE1.[Entry Type] = 4
解决方案
推荐阅读
- javascript - 结合对象数组的特定属性
- azure-devops - 在 azure 管道 yaml 中获取合并的分支名称
- reactjs - 如何在具有 ReactJs 代码的 Wildfly 中配置静态 index.html
- matlab - 以下 .sh 脚本是否有资格被并行处理?
- javascript - ReactJS - 仅在 ComponentDidMount 之后调用函数一次
- firebase - Flutter 将多张图片上传到 Firebase
- android - 当应用程序从前台被杀死时在 Ionic 应用程序中显示通知
- java - 如何从 RecyclerView Android 中的编辑文本中获取价值
- flutter - 在 Flutter 中重新实例化 Provider 创建的类
- swift - 我的代码中出现 Pthread 终止错误,不知道为什么。// swift