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:
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:
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: