Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8078679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:52:23+00:00 2026-06-05T15:52:23+00:00

I have a datatable which contains yearly data saved. e.g. dtDate Value 2010-01-01 00:00:00.000

  • 0

I have a datatable which contains yearly data saved. e.g.

dtDate                      Value
2010-01-01 00:00:00.000     5.0000
2011-01-01 00:00:00.000     15.0000
2012-01-01 00:00:00.000     25.0000
2013-01-01 00:00:00.000     35.0000
2014-01-01 00:00:00.000     45.0000

Now i want to use this datatable for monthly process. so for all months in year 2010 i want to use value=5. e.g. If my date is 02/01/2010 Feb 2010 it should return me

How do I use datatable.select method? I want some effective filter expression.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:52:24+00:00Added an answer on June 5, 2026 at 3:52 pm

    The DataTable.Select(filterExpression) overload method contains the parameter filterExpression that use the same syntax used to create calculated columns via the Expression property.

    You could use this code to get required row

    Dim dt as DateTime dt = new DateTime(2010,1,1,0,0,0)
    Dim r as DataRow() r = DataTable.Select("dtDate = #" + dt.ToString("yyyy-MM-dd") + "#");
    

    If your intention is to get the record for year 2010 passing any date with year = 2010 then you could use this syntax

    ' Supposing date passed is 1/May/2010 and you want the record with 2010 as year.
    Dim dt as DateTime dt = new DateTime(2010,5,1,0,0,0)  
    Dim r as DataRow() r = DataTable.Select("dtDate = #01/01/" + dt.Year.ToString()) + "#");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataTable which contains data in this format. I want to convert
I have a datatable which contains following data as SrNo Roll Name 1 1
i have a datatable which contains InvalidCodes. Before uploading the data to database(data is
I have a huge data.table in R which contains the result of a experiment:
I have a DataTable which I select from database (Well, these data cross several
I have a System.Data.DataTable which is populated by reading a CSV file which sets
I have a form which contains a DataGridView, a BindingSource, a DataTable, and a
I have a datatable which contains all these records (see SQL query). Instead of
I have a Business Object which contains a DataTable among other properties. I pass
I have a datagridview with a bound combobox column which contains decimal value. There

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.