大家好,
我有以下程式碼不起作用:
// Current date
aujourd'hui = Text(Today(),"00000000");
// Obtain the month number format "MM"
numero_mois = Text(Month(aujourd'hui), "00");
// Obtain the year number - 1 format YYYY
numero_annee = Text(Year(aujourd'hui) - 1, "0000");
// Concatenate the result
date_debut_mois_actuel_Y = ("01" || numero_mois || numero_annee);
// Show the result
Show(date_debut_mois_actuel_Y);
dt << Select Where(:Date < date_debut_mois_actuel_Y);
dt << Delete rows;目標是從 dt(資料表)中選擇日期 < 01/當前月份/當前年份 -1 的所有行,並將其刪除。
我理解這個錯誤,即我無法連接字元以外的其他元素,但是如何獲取 01/10/2022 格式下的日期(例如今天的預期),而無需返回代碼並手動更改日期。
錯誤訊息是:參數應該是存取或評估'Concat'時第xxx行的字符,錯誤的參數(numero_mois),「01」|| /*###*/numero_mois || /*###*/numero_annee/*###*/
最新的程式碼是(每月手動修改):
dt << select where(:name("date") < informat("01102022","DDMMYYYY"));
dt << Delete rows;非常感謝 !
此致