Filemaker 计算字段 ExecuteSQL 和 Case
Filemaker calculated fields ExecuteSQL and Case
我正在尝试使用 FM 起点在 filemaker 中处理计算字段。我是电影制作人的新手,之前问过一个问题,现在我正在扩展; 。我现在将估算移至发票,与我之前的问题类似,估算可以有多个发票,因此我想为每个发票添加一个字母。根据之前的回答,我正在尝试使用与 'case' 配对的计数函数(我正在寻找一个 if 语句,而 filemaker 文件似乎表明我需要的是大小写)将计数转换为字母。但它一直要求我使用操作员,但我不确定我在哪里需要它。
这是我的代码,感谢您的帮助。
$var1 =
ExecuteSQL (
"SELECT COUNT(*) FROM T12_INVOICES WHERE id_estimate = ?" ;
"" ; "" ;
T12_INVOICES::id_estimate
)
Case (
$var1 = 1; "A";
$var1 = 2; "B";
$var1 = 3; "C";
$var1 = 4; "D";
$var1 = 5; "E";
$var1 = 6; "F";
$var1 = 7; "G";
$var1 = 8; "H";
$var1 = 9; "I";
"Z"
)
id_estimate & $var1
像这样应该可以解决问题:
let([
$var1 = ExecuteSQL ("SELECT COUNT(*) FROM T12_INVOICES
WHERE id_estimate = ?" ; "" ; "" ; T12_INVOICES::id_estimate);
$var2= Case (
$var1 = 1; "A";
$var1 = 2; "B";
$var1 = 3; "C";
$var1 = 4; "D";
$var1 = 5; "E";
$var1 = 6; "F";
$var1 = 7; "G";
$var1 = 8; "H";
$var1 = 9; "I";
"Z"
)];
id_estimate & $var2
)
查看 Choose 函数以获得更简单的 Case 语句。
我正在尝试使用 FM 起点在 filemaker 中处理计算字段。我是电影制作人的新手,之前问过一个问题,现在我正在扩展;
这是我的代码,感谢您的帮助。
$var1 =
ExecuteSQL (
"SELECT COUNT(*) FROM T12_INVOICES WHERE id_estimate = ?" ;
"" ; "" ;
T12_INVOICES::id_estimate
)
Case (
$var1 = 1; "A";
$var1 = 2; "B";
$var1 = 3; "C";
$var1 = 4; "D";
$var1 = 5; "E";
$var1 = 6; "F";
$var1 = 7; "G";
$var1 = 8; "H";
$var1 = 9; "I";
"Z"
)
id_estimate & $var1
像这样应该可以解决问题:
let([
$var1 = ExecuteSQL ("SELECT COUNT(*) FROM T12_INVOICES
WHERE id_estimate = ?" ; "" ; "" ; T12_INVOICES::id_estimate);
$var2= Case (
$var1 = 1; "A";
$var1 = 2; "B";
$var1 = 3; "C";
$var1 = 4; "D";
$var1 = 5; "E";
$var1 = 6; "F";
$var1 = 7; "G";
$var1 = 8; "H";
$var1 = 9; "I";
"Z"
)];
id_estimate & $var2
)
查看 Choose 函数以获得更简单的 Case 语句。