Re: PLEASE HELP with CALC for MIN & MAX




You're OK, I undersood what you said, I BELIEVE.

Even though I know the ASSUME THEORY I ASSUMED the # would be the actual
# of days like 12/31/05-1/1/05 would be 365 and not 364.

I guess I am being too wordy. Are there any SPECIFIC rules regarding the
arithmentic of Dates? I'm looking for some rules about when a date range
will be INCLUSIVE.

It seems like:
a) 02/1/06-1/15/06 is INCLUSIVE (17)
b) 12/31/05-9/15/05 is INCLUSIVE (107)
BUT
c) 10/1/06-1/1/06 is NOT INCLUSIVE (9)

I don't understand why a&b are INCLUSIVE and c is NOT...

SORRY - maybe it's in my face and I just don't see it !

Liz McGuire <liz@xxxxxxxxxxxxxxxxxxxx> wrote:
I don't know how else to explain it. 198 excludes the start date from
the calculation. 90 and 107 exclude two start dates from the
calculation. If you want to exclude the start date, I reckon you'll
have to:

a) use the min start and max end - gets you 198

OR

b) count how many rows there are for the given street, sum the two
ranges and add n-1, where n is the number of rows.

Or something.

Liz


Jeanette wrote:
Helpful but...
the idea is to get a daily cost and project it given the BGN & END dates
and then the amounts should roll up to the original StreetCost.

It's not happening if I use 199 days for the example below.
HOWEVER if the BGN & END dates were not broken up by a RptYear the TNOD
would
be 198 and that allows an accurate rollup to the StreetCost BUT as (END-BGN).

AND using dates 1/15/06 thru 2/1/06 and 9/15/05 thru 12/31/05 for 2 seperate
streets (END-BGN)+1 does not allow an accurate rollup to the StreetCost
-
it does if (END-BGN)is used...

WHAT TO DO ????




"Liz McGuire" <liz@xxxxxxxxxxxxxxxxxxxx> wrote:
Jeanette,

1 through 10, inclusive, includes a total of 10 numbers.

10 - 1 = 9

1 is subtracted, so there's only 9 numbers left.

The first date range (2005) has 108 days, inclusive. The second has
91
days
(inclusive). Together, there are 199 days (inclusive).

However, when you're doing date math, "EndDate - StartDate" **subtracts
the
start date**. In other words, the StartDate is not being included in
the
count of days. If you want to be inclusive, do:

(EndDate-StartDate)+1

...then you'll get 108 days in 2005, 91 days in 2006 and 199 days total.

HTH,

Liz


"Jeanette" <harrisjr@xxxxxxxx> wrote:
I am creating a report that shows construction Cost projections.
Given the bgn & end dates Costs are shown via Month and Year.
For each street I calc the # of days between bgn & end and sum them
to
get
a grand total # of days (TNOD). The street cost is divided by TNOD for
a
daily cost.

here's the hitch - in the example below:
2005 # = 107
2006 # = 90 for a TNOD of 197
if I were able to get the # of days via MAX(end) - MIN(bgn) I would
have
a TNOD of 198 since the dates are consectuve months.

Can you help me code this occurence?

Year StreetCODE StreetCost Begin End
2005 06520 $282,208.40 09/15/2005 12/31/2005
2006 06520 $282,208.40 01/01/2006 04/01/2006




.