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

  • Home
  • SEARCH
  • 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 4590908
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:19:08+00:00 2026-05-21T22:19:08+00:00

I´ve come to a total stop with my program and im in need of

  • 0

I´ve come to a total stop with my program and im in need of some help.

I got an xml file with customer billings and billing dates. This file has about 4000 billing dates. What i want is to sort them so the once that is in a range of a period date of 2010-04-01 - 2011-03-31 adds to a table column named period1. And the other dates goes to period2 that is 2011-04-01 - 2012-03-31.

Ive been testing and testing this solution in diffrent ways but it wont work. Im adding all the dats to a list named dates. And trying:

if (dates.All(date => date >= startDatePeriod1 && date <= stopDatePeriod1))
{
    adapterBonus.InsertPeriod1Query(// insert to database));
}
else if (dates.All(date => date >= startDatePeriod2 && date >= stopDatePeriod2))
{
    adapterBonus.InsertPeriod2Query(// insert to database));
}

startDatePeriod1 = 2010-04-01
stopDatePeriiod1 = 2011-03-31  

and so on

  • 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-05-21T22:19:09+00:00Added an answer on May 21, 2026 at 10:19 pm

    The Enumerable.All extension method returns true if every element in the sequence verifies the condition. If dates contains dates in both periods, none of the ifs will run, because both calls to Enumerable.All will return false.

    I’m not sure what you mean by “adds to a table column named period1”, but if you mean to count all the dates in each period, use Enumerable.Count:

    int period1Count = dates.Count(date => date >= startDatePeriod1 && date <= stopDatePeriod1);
    int period2Count = dates.Count(date => date >= startDatePeriod2 && date <= stopDatePeriod2);
    adapterBonus.InsertPeriod1Query(period1Count);
    adapterBonus.InsertPeriod2Query(period2Count);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How come this works: import datetime now = datetime.datetime.now() month = '%d' % now.month
I`v come across a need where I want to create multiple list items from
This below output come from php json_encode.What we see here is 0849 is twice.Since
i just come to install maven2, after configuring the settings.xml in ${user.home}/.m2 and fixing
I cant even come up with a proper subject for this one... Basically I
I have a problem I'm hoping someone has come across and can help. I
I'm trying to come up with a reasonable algorithm for this problem: Let's say
I am using Excel to create some formuals to calculate a total dollar ammount
I am a total jQuery newbie (well web coding newbie come to that) and
I've come across the following example from this tutorial : class Song @@plays =

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.