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 242473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:50:26+00:00 2026-05-11T20:50:26+00:00

In my database I have a table holding some subscription information. I have among

  • 0

In my database I have a table holding some subscription information. I have among others a StartDate and an EndDate as DateTime.

What I need is to make a Linq query getting all rows due for payment. The payment is supposed to take place each month on the same day they registered (StartDate) and stop on the EndDate. So if they registered on the 23. May, I need to invoice them again 23. June, 23. July and so on.

var query = from c in db.Subscription
            where c.StartDate.Value.Day == DateTime.Now.Day
            // What if today is Feb. 28 and a customer registered January 31.
            // What if....

I am lost…please help!

Best,
Jon 2H

  • 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-11T20:50:26+00:00Added an answer on May 11, 2026 at 8:50 pm

    Why don’t you create a seperate table for all due payments.

    When a new subscription is taken out, you would calculate all future payment dates for that subscription, and add a number of rows into the DuePayments table with the SubscriptionID, PaymentDate & Amount.

    The number of rows would equate to the number of months between the subscription start date and end date, and the payment dates could be easily calculated using DateTime.AddMonths(1) while less than end date.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an Oracle database, and the customer account table has about a million
Often times applications will need some database code tables (aka reference tables or domain
I have a small problem with some late additions to a project, mysql and
I have a table of player performance: CREATE TABLE TopTen ( id INT UNSIGNED
When I have two mysql servers that have different jobs (holding different databases) but
I am currently updating a webpage that has some very simple data displayed in
I'm looking for the best way to design a shopping cart. I'm at a
I've been looking at the rise of the NoSql movement and the accompanying rise
I am in the process of renovating our CMS and I've run into a

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.