Dates without years

Cavern

Registered User.
Local time
Today, 15:53
Joined
Jul 12, 2002
Messages
31
I'm creating a database to store a bunch of information on various animal species, and one of the peices of information I would like to store is the migration and breeding dates of the animal. I was wondering if there was a way I could use the Date type for this information, and be able to store/compare dates without keeping track of the year at all.

Currently I'm storing the day# (out of 365) that the breeding/migrating period starts and ends as a Number type, then computing which month/day that is when it needs to be displayed. This makes the comparasons easy, but displaying this in a meaningful way to the user is cumbersome.

Is there a better way? Keep in mind, I need to be able to find if a date falls within the breeding / migrating period (even if the period spans the year-end). And that birds don't migrate from July 21, 2001 - August 31, 2005.... (ie years not important).
 
Cavern,

Have looked at using the DatePart() function. I think it will do a lot of what you need.

Ken
 
You can't work with date functions unless the data is actually stored as a date. You might pick an arbitrary year such as 2000 and enter all your data for that year.

To convert "day #" to a date for this year, add the number of days to jan 1st

DateAdd("d", DayNum -1, "1/1/" & Year(Date()))
 

Users who are viewing this thread

Back
Top Bottom