Filter datetimepicker (Start Date end Date)

Hello
I've got a database in access and i'm trying to do my first steps in VB Express 2005.
I had made a datagridview from one table of my database which contens many columns, one of that column is the field DATE.
1. I want to filter the datagridview by date ( lets say 1/1/2005 to  31/06/2005 - i had made to DateTimePicker fields with value of date).
2. How can i set default value "*" or "ALL" to a Combobox and then use it to filter the datagridview (Combobox get values from a datasource and contains names of CustomerField)

Sorry for my very bad English

Thank's


Answer this question

Filter datetimepicker (Start Date end Date)

  • rpcservererrorguy

    I have write something like this

    Dim DateRangeFrom as String
    Dim DateRangeTo as string

    DateRangeFrom = DateTimepicker1.Value.Date()
    DateRangeTo = DateTimePicker2.Value.Date()

    Me.TicketBindingSource.Filter = ("DateReceived >=" + DateRangeFrom + "and DateReceived <=" + DateRangeTo)

    I'm getting an error that says that can't filter DateReceived with DateRangeFrom because the one field is system.Date and the other is system.double.

    I don't what to do, if anyone can help

    Thank's



  • Conch&amp;#250;r

    you can either use the rowfilter property of the dataview or you can use the correct sql statement for your select command:


    filter or where clause would look something like:

    FIlterString = TheDate & "> #1/1/05# And " & TheDate & " < #12/31/05#"



  • Filter datetimepicker (Start Date end Date)