SELECT TOP 10 * FRO M {订单}
以上是从后台订单表提取10条记录。我想记录数是东态交互的,以下SQL语句不行
If Forms("销售订单").Controls("RadioButton4").Checked = True
Dim g As Single
g = Forms("销售订单").Controls("排名").text
Dim cmd As New SQLCommand
Dim dt As DataTable
cmd.C
cmd.CommandText = "Select top g 客户,sum(订单数量) as 数量,sum(金额) as 金额 Fro m {销售订单} group by 客户 order by sum(金额) desc"
dt = cmd.ExecuteReader()
Tables("销售订单_销售订单统计表").DataSource = dt
Tables("销售订单_销售订单统计表").AutoSizeCols() '设置自动列宽
End If