问题描述
我只想要特定日期的记录。不要在条件标准中给出时间。
请指导...
Dim fndRows()As DataRow
fndRows = DataSet1.TransactionTestMaster.Select(" trandate = '15 / 02/2014'")
TextBox4.Text = fndRows.Length
3记录在TransactionTestMaster表中
TranDate(列名)
1)2014-02-15 16:51:00
2)2014-02-15 17:45:00
3)2014-04 -16 17:48:00
请指导....
I want records of particular date only. Not to give time in condition criteria.
Please guide...
Dim fndRows() As DataRow
fndRows = DataSet1.TransactionTestMaster.Select("trandate='15/02/2014'")
TextBox4.Text = fndRows.Length
3 Records are in TransactionTestMaster table
TranDate ( Column Name)
1) 2014-02-15 16:51:00
2) 2014-02-15 17:45:00
3) 2014-04-16 17:48:00
Please guide....
推荐答案
fndRows = DataSet1.TransactionTestMaster.Select("DATEDIFF(d, '2014-02-15', trandate)=0")
Dim fndRows() As DataRow
Dim dt1, dt2 As Date
dt1 = DateTran.Value.AddDays(-1)
dt2 = DateTran.Value.AddDays(1)
fndRows = DataSet1.TransactionTestMaster.Select("trandate >' " & dt1 & "' and trandate <'" & dt2 & "'")
TxtDaySrNo.Text = fndRows.Length + 1
这个有效。
This is working.
这篇关于记录仅基于日期过滤器而不是时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!