Results 1 to 2 of 2

Thread: Need to filter binding source on date value

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    South Charleston, WV, USA
    Posts
    607

    Need to filter binding source on date value

    The table field [recordaddeddate] is a Date/Time field in my Access database. Usually this field contains a date + time value. For filtering on my datagridview I want to filter on the date portion only. However the following genterates a 'The expression contains an unidentified function call DateValue' error. How can I filter on just the date?

    Code:
            DateSelected = DateValue(Me.AddedDateDateTimePicker.Value)
            Me.ConversationTblBindingSource.Filter = "DateValue([recordaddeddate]) = #" & DateSelected & "#"

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Need to filter binding source on date value

    The BindingSource has no knowledge of your Access database. It only supports what the documentation says it supports. I'm sure that you've read that documentation.

    If you want to test just the date then you can test that the date & time is greater than or equal to some date and less than one day later than that date.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width