View Full Version : DateDiff in Table itself?


usachrisk
06-18-2002, 07:50 AM
Hello,

I know how to use the DateDiff function in a form so that I could find out the differences between two dates, but is this at all possible directly in the table? I.E. for simplicity sake, let's say I have four fields in one example table:

ID (autonumber)
Start Date (Date/Time)
End Date (Date/Time) and
Difference (Int(?))

Could I have the Difference Field automatically calculate the difference between the first two fields in its own record?

Thanks,
Christopher.

Rich
06-18-2002, 11:50 AM
Since the value is calculated you shouldn't store the diff at all, either calculate it at form or report level.

RichMorrison
06-18-2002, 11:56 AM
As far as I know, you can not do this in a table in Access 2.0 or Access97.

The "Default Value" property of a table field can not contain an expression that refers to other fields in the table.

You could create an Append query to populate a table and do the calculation in the query.

RichM