I'm trying to spread revenue dollars over several months based upon a start date and end date. I have a formula and excel that will populate the number of days that fall with in that month if the start and end dates fall within that period.

Below is an example of that formula in excel for the January '09 column (My start date is 1/11/09 and my end date is 1/24/09):

=MAX(0,(MIN(references End date cell,DATE(YEAR(references 1/1/09 cell),MONTH(references 1/1/09 cell)+1,0))-MAX(references Start date cell,references 1/1/09 cell)+1))

My result is that it shows 14 days of the start and end date occurred in the month of January.

Can anyone tell me how I can permorm this function in Access??