按年份过滤绑定源 [英] Filter a binding source by year

查看:47
本文介绍了按年份过滤绑定源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何按年份过滤绑定源日期?

How do you filter a binding source date by year?

Me.tblComplaintLogBindingSource.Filter = "Date = '" & frmYear.ComboBox1.Text & "'"


我的日期是MM/dd/yyyy format


My date is MM/dd/yyyy format

推荐答案


如果日期"列仅保留年份,则您的代码将起作用.所以我想,从日期"列中提取年份或将日期"与实际的日期字符串进行比较应该可以.看看参考: MSDN [
Hi,
your code would work, if the ''Date'' column would only hold the year. So I guess, extracting the year out of the column ''Date'' or compare ''Date'' with an actual Datestring should work. Have a look at the reference: MSDN[^]


这篇关于按年份过滤绑定源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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