all groups > dotnet windows forms databinding > january 2005 >
You're in the

dotnet windows forms databinding

group:

filter expression with date AND TIME


Re: filter expression with date AND TIME Bob Grommes
1/9/2005 10:06:48 AM
dotnet windows forms databinding:
If the Value property of the controls is a datetime variable then just add
the time to the format string you already have. If the time is stored
separately then create a TimeSpan instance from the time value and add it to
the date, and then format it all together.

--Bob

[quoted text, click to view]

filter expression with date AND TIME MajorTom
1/9/2005 12:15:21 PM
Hello everybody

I using an dataview rowfilter expression to filter some record from one
dataset, is I only working with the date portion no problem, but how do I
use the date and the time for filter some records ?
the code that I have is like this one:

crit1 = "fecha >= #"+dtpDesde.Value.ToString("MM/DD/YYYY")+"#";
crit2 = "fecha <= #"+dtpHasta.Value.ToString("MM/DD/YYYY")+"#";
filtro = crit1 + " AND " + crit2 ;

my datetime picker dtpDesde and dtpHasta have the time in there format and
the field fecha is datetime and I want to filter by time to.

Please, any help ?

MajorTom

Re: filter expression with date AND TIME MajorTom
1/9/2005 1:17:42 PM
thank for your help

like this:
....ToString("MM/dd/yyyy HH:mm")+"#";

I going to test it

Thanks againg

MajorTom

[quoted text, click to view]

AddThis Social Bookmark Button