Rowfilter and DateTime RRS feed

  • Question

  • Hi,

    I have a simple problem: after loading a datatable I must filter the date column (datetime in the italian format "dd/MM/YYYY HH: mm: ss"), ignoring the time.

    I searched and I tried several solutions but I have not solved

    trivially in the cell I see for example "08/03/2010 19:37:39"

    If i write:

    myDataTable.DefaultView.RowFilter = "Date = #03/08/2010 19:37:39#";

    I do not return any results, how can?





    Tuesday, August 3, 2010 7:13 PM


  • That is probably because the value has been rounded.  There might be milliseconds, etc. that you cannot see in the grid but which exist in the actual value.


    "Date >= #03/08/2010# And Date < #03/09/2010#";

    This will give the full range from 3/8/2010 00:00:00.000[etc...] to 23:59:59.999[etc...].


    Tuesday, August 3, 2010 10:51 PM