代码如下
Dim cmd As new SQLCommand
cmd.Co nnecti
cmd.Co mmandText = " s elect * from ( s elect 货号 ,订单号,客户品番,箱数,出货时间,扫描数量,上传时间 , (箱数 - 扫描数量) as 扫描数与计划差 from 订单明细 where 出货时间 < #" & Date.now & "# and 出货时间 > #" & Date.now.AddDays(-10) & "# ) as a where 扫描数与计划差 <> 0"
Dim dt As DataTable
dt = cmd.ExecuteReader
dt.DataCols("上传时间").SetFormat(DateTimeFormatEnum.DateTime)
dt.DataCols("扫描时间").SetFormat(DateTimeFormatEnum.DateTime)
Tables("窗口1_table1").DataSource = dt
显示的列格式 还是 date 格式 11/01/2017
如果变为 datetime 格式 11/01/2017 08:30
[此贴子已经被作者于2017/5/28 9:27:07编辑过]