Raconteur
Member
Hi Gang,
I am trying to do something that must be simple but cannot for the life of me figure it out... first off, I am using VB.NET and SQL Server.
What I want to do is filter the records of the DataSet underlying my DataView by using the RowFilter property of the DV. The problem is the column I want to filter on is an SQL DateTime. So, basically what I am looking for is something like this:
"scheduled_completion_date < " + System.DateTime.Today
in the RowFilter property.
When I do this I get an error that a System.DateTime cannot be compared to a System.Double (the Today value). So I try to use FromOADate on it:
"scheduled_completion_date < " + System.DateTime.FromOADate(System.DateTime.Today)
but VS.NET complains at that call saying that if I pass DateTime.Today as the argument, I must first convert it to a Double by using ToOADate. So now my call looks like:
"scheduled_completion_date < " + System.DateTime.FromOADate(System.DateTime.Today.ToOADate)
which is just ridiculous... but it STILL doesnt work. I get the same "cannot compare DateTime to Double" error!
How in the world do I do this?!?!?
TIA for any input.
Cheers,
Chris
I am trying to do something that must be simple but cannot for the life of me figure it out... first off, I am using VB.NET and SQL Server.
What I want to do is filter the records of the DataSet underlying my DataView by using the RowFilter property of the DV. The problem is the column I want to filter on is an SQL DateTime. So, basically what I am looking for is something like this:
"scheduled_completion_date < " + System.DateTime.Today
in the RowFilter property.
When I do this I get an error that a System.DateTime cannot be compared to a System.Double (the Today value). So I try to use FromOADate on it:
"scheduled_completion_date < " + System.DateTime.FromOADate(System.DateTime.Today)
but VS.NET complains at that call saying that if I pass DateTime.Today as the argument, I must first convert it to a Double by using ToOADate. So now my call looks like:
"scheduled_completion_date < " + System.DateTime.FromOADate(System.DateTime.Today.ToOADate)
which is just ridiculous... but it STILL doesnt work. I get the same "cannot compare DateTime to Double" error!
How in the world do I do this?!?!?
TIA for any input.
Cheers,
Chris