Date Manipulation

B

Bunky

I have a query that has a field called Date Avail. The data coming into the
query has been sorted and now is being grouped on the key fields (Date Avail
is NOT one.) I have put a count function on a unit code and then did a First
on the Date Avail field to find the first date associated with the group. I
have done the same using Last for the same field. I then do a datediff
between the two dates in days
DateDifference: DateDiff("d",[FirstOfDate Avail],[LastOfDate Avail])

This was working fine until I got to dates that are crossing into next year.
Example: Unit 201 is first available on 12/07/07 and last available on
2/2/08. But the query has flipped the first and last dates and the
subtraction shows -57 days. It appears if the dates are all in 07 or 08 and
no crossings, it works fine.

Ideas are greatfully appreciated;
Thanks in advance for your help!
 
Top