以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 关于SQL (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=191531) |
-- 作者:实话实说 -- 发布时间:2024/4/21 11:02:00 -- 关于SQL 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
|
-- 作者:有点蓝 -- 发布时间:2024/4/21 22:11:00 -- 基础问题:http://www.foxtable.com/webhelp/topics/0221.htm cmd.CommandText = "Select top " & g & " 客户,sum(订单数量) a...........
|