我如何在我的数据提供者中使用 MAX() 和 WHERE?

How i can use in my data provider MAX() and WHERE?

我需要 return 我的最大 pedcod 数量 peduf = "SP".

我试试:

Tpedpro
where peduf = "SP"
max(pedcod)
{
    Pedcod = Pedcod + 1
}

Tpedpro 是我的交易table。 但我收到:

error src0110: Missing group start brace '{' error src0115: Invalid expression after group definition; are you trying to define a subgroup?

您不必使用 DataProvider 来获取该值。 只需在过程的源代码中使用内联公式:

&MaxPedCod = max(PedCod, peduf = !"SP")

如果你真的想使用DataProvider,你可以这样写:

Tpedpro [one]
order (pedcod)
where peduf = "SP"
{
    Pedcod = Pedcod + 1
}

这意味着:获取 peduf = "SP" 的第一条记录,降序为 pedcod