Foxtable(狐表)用户栏目专家坐堂 → [求助] 直接读取数量


  共有4866人关注过本帖树形打印复制链接

主题:[求助] 直接读取数量

帅哥哟,离线,有人找我吗?
leoli
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:301 积分:2547 威望:0 精华:0 注册:2018/11/15 12:35:00
[求助] 直接读取数量  发帖心情 Post By:2022/4/2 17:36:00 [只看该作者]

老师,以下代码是从后台数据库rdrecords11直接下载到foxtable表rdrecords11中。

那如何直接在表rdrecords11的表属性中,直接从后台汇总表rdrecords11中,当在rdrecords11产品名全部列出来后,谢谢。



Dim cmd As New SQLCommand
Dim dt As DataTable
DataTables("rdrecords11").datarows.clear
cmd.Con nection Name = "axalta" 
Dim Cols111() As String = {"cInvcode","iquantity"}
Dim Cols222() As String = {"PartNo","Qty"}
cmd.CommandText ="se /lect cInvcode,年,月,sum(iquantity) as iquantity from (Se lect cInvcode,iquantity,year(ddate) as 年,month(ddate) as 月 From ({rdrecord11} Inner JOIN {rdrecords11} ON {rdrecords11}.[ID] = {rdrecord11}.[ID]) Where [dDate] > = '" & e.Form.Controls("Datetimepicker1").Value & "' And [dDate] < = '" & e.Form.Controls("Datetimepicker2").Value & "') as a group by cInvcode,年,月"
dt = cmd.ExecuteReader()
For Each dr1 As DataRow In dt.DataRows
    Dim dr2 As DataRow = DataTables("rdrecords11").AddNew()
    For i As Integer = 0 To Cols111.Length -1
        dr2(Cols222(i)) = dr1(Cols111(i))
    Next
    dr2("date") = new Date(dr1("年"),dr1("月"),1)
Next


 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110813 积分:564003 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/4/2 17:41:00 [只看该作者]

没看懂想表达的什么意思?

 回到顶部