如何在datagridview VB.NET中的两个日期之间过滤名称 [英] How to filter names between two dates in datagridview VB.NET
本文介绍了如何在datagridview VB.NET中的两个日期之间过滤名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有数据如
姓名日期
jhon 11/11/2018
dj 11 / 12/2018
dj 11/10/2018
dj 20/12/2018
name11 20/12/2018
当我尝试使用文件管理器然后只将日期 01/12/2018
改为 31/12/2018
然后显示2个名称 dj
和 name11
show我尝试过滤器名称然后显示所有 dj
不在 01/12
到 31/12
之间。
我尝试了什么:
我 .InvoiceSalesBindingSource.Filter = [Party_Name] ='& ComboBox1.Text& '& 日期> ='& TextBox1.Text& '和日期< ='& TextBox2.Text& '
解决方案
我得到了解决方案代码中的一些更改
我 .InvoiceSalesBindingSource.Filter = 日期> ='& TextBox1.Text& '和日期< ='& TextBox2.Text& '和Party_Name ='& ComboBox1.Text&
Me.InvoiceSalesBindingSource.Filter =Party_Name ='& ComboBox1.Text& '和约会之间< pre>'& TextBox1.Text& '和'& TextBox2.Text&
i have data like
names date
jhon 11/11/2018
dj 11/12/2018
dj 11/10/2018
dj 20/12/2018
name11 20/12/2018
when i try to filer then only dates 01/12/2018
to 31/12/2018
then show 2 names of dj
and name11
show and i try filter names then shows all dj
not between 01/12
to 31/12
.
What I have tried:
Me.InvoiceSalesBindingSource.Filter = "[Party_Name] ='" & ComboBox1.Text & "'" & " Date >='" & TextBox1.Text & "' And Date <='" & TextBox2.Text & "'"
解决方案
i got solution some changes in code
Me.InvoiceSalesBindingSource.Filter = "Date >='" & TextBox1.Text & "'And Date <='" & TextBox2.Text & "'And Party_Name ='" & ComboBox1.Text & "'"
Me.InvoiceSalesBindingSource.Filter = "Party_Name ='" & ComboBox1.Text & "' AND Date BETWEEN <pre>'" & TextBox1.Text & "' AND '" & TextBox2.Text & "'"
这篇关于如何在datagridview VB.NET中的两个日期之间过滤名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文