0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

rex0220 項目検証プラグイン テーブル内日付の重複チェック

Last updated at Posted at 2025-06-27

項目検証プラグインでテーブル内日付の重複チェックを行います。

概要

開始日・終了日で、前行までに期間の重複がある行をエラーとします。

2025-06-27_14h35_02.png

項目検証プラグイン設定

開始日と終了日にカスタムチェックを入れます。

2025-06-27_14h38_56.png

  • 開始日のチェック
    • 開始日と終了日の期間チェック

2025-06-27_14h39_34.png

  • 終了日のチェック
    • 開始日より前の場合にエラー
    • 開始日と終了日の期間チェック(開始日のチェックと同じ)

2025-06-27_14h40_01.png

  • 各チェック用計算式
項目検証プラグイン
APP: 日付重複チェック (3613)
NOTE: 

// テーブル.開始日 DATE
 //* custom check-1:
LET(
  pos, ROWNO(テーブル),
  curStart, 開始日,
  curEnd, 終了日,
  arr, ARRAY_FOR(pos,idx,
    IF(AND(SUBTABLE(終了日,idx)>=curStart, SUBTABLE(開始日,idx)<=curEnd),
     1,0
    )
  ),
  IN(arr, 1)
)
 //* message ja:
"重複"

// テーブル.終了日 DATE
 //* custom check-1:
開始日>終了日
 //* message ja:
"開始日>"
 //* custom check-2:
LET(
  pos, ROWNO(テーブル),
  curStart, 開始日,
  curEnd, 終了日,
  arr, ARRAY_FOR(pos,idx,
    IF(AND(SUBTABLE(終了日,idx)>=curStart, SUBTABLE(開始日,idx)<=curEnd),
     1,0
    )
  ),
  IN(arr, 1)
)
 //* message ja:
"重複"

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?