visual studio - vb.net filter binding source by time -
hi there have database date/time
(highlighted in red in image below) fields , formatting medium time
shown below.
and field type , format of log_in_time
field..
i've connected database vb.net project , i'm using following code filter binding source log_in_time
field of database. i'm using datetimepicker
input source. note logouttime
datetimepicker
code..
private sub logintime_valuechanged(byval sender object, byval e system.eventargs) handles logintime.valuechanged, logintime.keypress 'filter binding source input data try '30-dec-99 default date time paymentdetailsbindingsource.filter = "log_in_time = '30-dec-99 " & logintime.text & "'" catch ex exception end try end sub
the format of datetimepicker
set custom format
hh:mm tt
problem above code not work, returns empty search result.. doing wrong appreciated.. thanks..
as per comment above, issue including more (or less) in filter in field.
if field contains 10:25 am
and filter includes date (so full filter string 30-dec-99 10:25 am
), return no matches or if field contains seconds time not match.
(in either case field formatted above show 10:25 am
.
if field contain time 10:25 am
try:
paymentdetailsbindingsource.filter = "log_in_time = '" & logintime.text & "'"
Comments
Post a Comment