G
Guest
I have a DataView (dv) that includes a StartDate DateTime column. I'd like to
return the DataView record that contains a StartDate value closest to my
IncidentDate value:
string filter = String.format("StartDate nearest {0}", IncidentDate);
dv.Rowfilter = filter;
Of course, there's no nearest function.
The IncidentDate could be anywhere in the range of StartDate values, so
simply sorting by the StartDate and taking the top record isn't good enough.
It appears that dv.Find() only accept objects. Otherwise that would work
pretty well.
Any suggestions?
Thanks,
return the DataView record that contains a StartDate value closest to my
IncidentDate value:
string filter = String.format("StartDate nearest {0}", IncidentDate);
dv.Rowfilter = filter;
Of course, there's no nearest function.
The IncidentDate could be anywhere in the range of StartDate values, so
simply sorting by the StartDate and taking the top record isn't good enough.
It appears that dv.Find() only accept objects. Otherwise that would work
pretty well.
Any suggestions?
Thanks,