syntia.wijaya
Member
Hi,
I have a datatable with several columns, which 2 of them is ActualStart and PlanStart. I do some filtering using bindingsource to grab subset of the data in datatable like this:
What I'm trying to do is getting row which ActualStart date is 30 days range of PlanStart date. For example: PlanStart #1-Sep-2006#, then all filtered rows have ActualStart > #1-Sep-2006# And ActualStart < #1-Oct-2006#
When doing it, EvaluationException is thrown with error message: Cannot perform '-' operation on System.DateTime and System.Int32. while I tried to use the query in database (SQL Server 2005) with exactly the same code, it works.
So, any suggestion how to solve it?
Thanks in advance.
I have a datatable with several columns, which 2 of them is ActualStart and PlanStart. I do some filtering using bindingsource to grab subset of the data in datatable like this:
VB.NET:
bs.Filter = "ActualStart-30 < PlanStart", bs is an instance of BindingSource.
What I'm trying to do is getting row which ActualStart date is 30 days range of PlanStart date. For example: PlanStart #1-Sep-2006#, then all filtered rows have ActualStart > #1-Sep-2006# And ActualStart < #1-Oct-2006#
When doing it, EvaluationException is thrown with error message: Cannot perform '-' operation on System.DateTime and System.Int32. while I tried to use the query in database (SQL Server 2005) with exactly the same code, it works.
So, any suggestion how to solve it?
Thanks in advance.