I need to filter on a TimeSpan column

C

Chuck

My table has a TimeSpan column. I need to filter it to find all rows
between two times. Say midnight to noon (00:00:00) to (12:00:00)

A filter expression for a date is: string filter = "mycolumn = #" +
mydatetime + "#". This doesn't work for TimeSpans.

The syntax for strings and numbers also don't work.

The only thing I can come up with is filter = "Convert(myTimeColumn,
System.String) = '" + mytime + "'";
and I am not sure about that either.

Any one have any ideas?

Chuck
 
C

Chuck

No. I mean System.TimeSpan. It can be used to indicate time of day
without knowing the date.

Chuck
 
B

Bernie Yaeger

Hi Chuck,

Sorry; I thought you were referring to sql server, but it's simply a vb .net
type.

Bernie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top