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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:09:59+00:00 2026-06-08T03:09:59+00:00

I have a situation where time spans will be calculated by according to a

  • 0

I have a situation where time spans will be calculated by according to a pilot’s date of birth.

Pilots have to get so many hours and such in every 6 month period. I’m annoyed that they aren’t all January-June and July-December, but apparently they have to do this sort of thing by their birth date.

Here’s a reference table:

enter image description here

Now, I need to be able to calculate all the flight hours for each pilot based on their two periods. For example, my birthday is October 23rd. This means my first 6 month period is November 1st through the end of April (of the next year). I’m looking for any ideas on how to create a reference table that will allow me to easily (or as easily as possible) calculate the flight hours for a particular time period.

Here’s what I’ve got so far:

enter image description here

Where birthMonth and startYear together are a composite primary key. startYear is what year the period starts in.

birthMonth is a NVARCHAR(50), startYear an Int, and the rest are Dates.

My pilot table with have birthDate as a full date, and then the flight manager will be able to select the startYear. What do you think? Should I combine the birth month and year into the same field? I’m just attempting to make a schema that will make for easy summing of a particular pilot’s flight hours for their semi-annual and annual. Maybe I could break up the date to not include the year, and then add it dynamically? I just think there are flaws in this design that I’m not thinking of.

EDIT: Here’s all the tables I’m currently working on:
enter image description here

  • 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-08T03:10:00+00:00Added an answer on June 8, 2026 at 3:10 am

    Do you really need a table?

    declare @birthday datetime = '2012-01-09'
    
    SELECT  DATEADD(dd,-(DAY(DATEADD(m,1,@birthday))-1),DATEADD(m,1,@birthday)) firstSixMonthStart,
            DATEADD(dd, -DAY(DATEADD(m,1,@birthday)), DATEADD(m,7,@birthday)) firstSixMonthEnd,
            DATEADD(dd,-(DAY(DATEADD(m,1,@birthday))-1),DATEADD(m,7,@birthday)) secondSexMonthStart,
            DATEADD(dd, -DAY(DATEADD(m,1,@birthday)), DATEADD(m,13,@birthday)) secondSixMonthEnd
    
    firstSixMonthStart      firstSixMonthEnd        secondSexMonthStart     secondSixMonthEnd
    ----------------------- ----------------------- ----------------------- -----------------------
    2012-02-01 00:00:00.000 2012-07-31 00:00:00.000 2012-08-01 00:00:00.000 2013-01-31 00:00:00.000`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I need to find time spans between value changes.
I have such situation: I do setcookie(bla,md5(bla),time()+36000) . After this I do see this
I have a situation in which I need to set a date and time
I have a situation where I have a product and a time dimension, with
I used to have a situation where I hit the database a every time
i have situation like this: class IData { virtual void get() = 0; virtual
I have an interesting situation here this time. This more of a conceptual question,
i have a situation where i need to calculate the remaining time every 6
i have a situation and couln't figure out for this time.Here's the question. I
I have a situation where for the first time I receive multitouch events on

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.