列名为 “时间” 为当前日期, 想用数值代替时间。
以2012年7月8日为基准 赋值为1
2012 07-09 =2
2012 07-10 =3
....
....
....
2012 07-20=13
类推。想用等号后面的数字自动替换前面的日期。主要是想要替换下面代码中的e.DataRow("时间")因为时间占位置太多,打条码的时候纸张太小。所以想用数值替换时间,还望各位前辈不吝赐教啊!!!
代码应该怎么写? 非常非常感谢。
Select e.DataCol.Name
Case = "商城","用户名","商号","楼层","ID"
If e.DataRow.IsNull("用户名") OrElse e.DataRow.IsNull("商号") Then
e.DataRow("取货商品名") = Nothing
Else
Dim bh As String = "D-" &e.DataRow("合并") & "-" &e.DataRow("商号") & "-" & e.DataRow("用户名") & "-" & e.DataRow("时间")'生成该月编号的前缀
Dim idx As Integer
idx = e.DataTable.Compute("Count(商品名)","商品名 like '" & bh _
& "*' and [_identify] < " & e.DataRow("_identify") & " ") +1
e.DataRow("取货商品名") = bh
End If
End Select
[此贴子已经被作者于2012-7-13 3:33:47编辑过]