先查询所有客户,然后查询客户数据,参考
For Each kh As String In DataTables("订单").GetValues("客户") Dim fdr As DataRow = DataTables("订单").find("客户 = '" & kh & "'","日期 DESC") If fdr IsNot Nothing Then Output.show(fdr("订单号")) End IfNext