DateDiff in Table itself? (1 Viewer)

usachrisk

Registered User.
Local time
Today, 08:44
Joined
Jun 12, 2002
Messages
16
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.
 
R

Rich

Guest
Since the value is calculated you shouldn't store the diff at all, either calculate it at form or report level.
 

RichMorrison

Registered User.
Local time
Today, 02:44
Joined
Apr 24, 2002
Messages
588
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
 

Users who are viewing this thread

Top Bottom