hello all i'm using vb2005. in one of the forms i'm using the filter method of the bindingsource i've used it before, but not on a date field. now, any comparison i try produces an error (things like): If tpToDate.Checked Then strFilter = "[chqCashDate]<=" & dtDate.Value ElseIf tpOnDate.Checked Then strFilter = "[chqCashDate]=" & dtDate.Value in this example, dtDate is a datetimepicker, tpToDate is a radio button, and chqCashDate is a smalldatetime field in a sql db table the error says something about invalid use of "=" operator. can someone please guide me in the right way? thanx in advance Erez.
Hi, You might take a look at DataColumn.Expression .net help topic on how to deal with date formats. -- Miha Markic [MVP C#] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ "Erez Mor" wrote in message news:9B725DCB-A138-4224-8269-7A02B31FAC1A@microsoft.com... > hello all > i'm using vb2005. > in one of the forms i'm using the filter method of the bindingsource > i've used it before, but not on a date field. > now, any comparison i try produces an error (things like): > If tpToDate.Checked Then > strFilter = "[chqCashDate]<=" & dtDate.Value > ElseIf tpOnDate.Checked Then > strFilter = "[chqCashDate]=" & dtDate.Value > > in this example, dtDate is a datetimepicker, tpToDate is a radio button, > and > chqCashDate is a smalldatetime field in a sql db table > > the error says something about invalid use of "=" operator. > can someone please guide me in the right way? > > thanx in advance > Erez.