none
Filter Date using DataBinding RRS feed

  • Question

  • Hi

    I have a datagrideveiw filled by adapter (there is 3 columns -ID-Sale-Date)

    I need to filter data in datagrideview by date between to date

    for examble I need data between 1-1-2009 to 1-1-2012

    I use this

    Me.DailyBindingSource.Filter = "_Day = '" & TextBox1.Text & "'"

    but it dosn't work

    What I can do ???


    I must Win

    Sunday, December 2, 2012 12:49 PM

Answers

  • You could try the following Filter:

    Me.DailyBindingSource.Filter = string.Format(

    "_Day >= '{0:dd-mm-yyyy}' AND _Day <= '{1:dd-mm-yyyy}'",

    myStartDateTime,

    myEndDateTime

    );


    Monday, December 3, 2012 7:19 AM

All replies

  • You could try the following Filter:

    Me.DailyBindingSource.Filter = string.Format(

    "_Day >= '{0:dd-mm-yyyy}' AND _Day <= '{1:dd-mm-yyyy}'",

    myStartDateTime,

    myEndDateTime

    );


    Monday, December 3, 2012 7:19 AM
  • I am so sorry but I still have question

    how I can use it with datePaker1 and DatePaker2

    if you can you add more description

    Thank you


    I must Win

    Monday, December 3, 2012 9:15 PM
  • Hi Kosay,

    Welcome to the MSDN Forum.

    >>how I can use it with datePaker1 and DatePaker2

    Please try this question in a new thread.

    Thank you for your understanding and support.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, December 13, 2012 9:12 AM
    Moderator