记录仅基于日期过滤器而不是时间 [英] Records based on only date filter not with time

查看:62
本文介绍了记录仅基于日期过滤器而不是时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想要特定日期的记录。不要在条件标准中给出时间。

请指导...



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....

推荐答案

不保证它 - 因为我不知道你的TransactionTestMaster.Select方法是如何工作的 - 但是试试这个:

Don't guarantee it - because I have no idea how your TransactionTestMaster.Select method works - but try this:
fndRows = DataSet1.TransactionTestMaster.Select("DATEDIFF(d, '2014-02-15', trandate)=0")


我得到了解决方案...



I got the solution...

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.


它无法正常工作。请做到需要或告诉别人......
It is not working. Please do needful or tell another way...


这篇关于记录仅基于日期过滤器而不是时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆