Filtering dataset on date fields

Posted on 2011-10-19
Last Modified: 2012-05-12
Hello Experts,

I am trying to filter a dataset with a filter by using MyDataSet.Tables("MyTable").Select("DateCol = Date")

It works fine as it is written now, but when I want to filter for a specific year or month I can't get it to work as the month() and year() functions don't seem to work when used in a filter expression.

How can I make a filter so that I can show all date fields from a specified month or year?

Thanks in advance.
Question by:Labelsoft
    LVL 22

    Accepted Solution

    Better approach is:

    Add one more column to datable (either from database query or before accessing for filtration.

    then apply filtering on that column for matching month.
    LVL 3

    Author Comment

    This sounds like an solution that I might take if there is no other way around it, but I prefer to be able to apply a filter directly on the date field, but from my searches on google I come to think that might not be possible.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now