I am posting my last email to you so everyone else can see the answer as well in case anyone needs the info.
One main problem you have here is you are not telling your query what you want your time calculated in.
You gave your query as:
SELECT Performance.GestationLength,
DateDiff([GestationLength],[KiddingDate],[MatingDate]) AS Expr1 FROM Matings INNER JOIN Performance ON Matings.FemaleAnimalCode = Performance.FemaleAnimalCode;
However the formula for DateDiff is: DateDiff("d", FirstValue, SecondValue) where "d" = days but you could also substitute other time variables.
Access doesn't recognize [GestationLength] as a date qualifier.
Therefore, structure your query as:
SELECT DateDiff("d",[KiddingDate],[MatingDate]) AS GestationLength FROM Matings INNER JOIN Performance ON Matings.FemaleAnimalCode = Performance.FemaleAnimalCode;
This will give you a number of days. If you want to update the GestationLength field in the table with this information then you would use an update query with the syntax of:
UPDATE Matings INNER JOIN Performance ON Matings.FemaleAnimalCode = Performance.FemaleAnimalCode SET Performance.GestationLength = DateDiff("d",[KiddingDate],[MatingDate]);
So, in closing, if you want to store the value of days between these dates in your table, you would use the update query. If you are just going to use this value in a report or query, then just use the select query above.
Hope this helped you!
Michael
[This message has been edited by mjbtx (edited 01-16-2002).]