date difference (1 Viewer)

bretch

Registered User.
Local time
Today, 21:48
Joined
May 19, 2003
Messages
17
Hi,
I have here a situation wherein i have two date fields a "start date" and an "end date". I would like to have a third field in the same table that would automatically store the date difference of the two fields in minutes...
How will this be done? Any help is highly appreciated....
thanks
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:48
Joined
Feb 19, 2002
Messages
43,522
There is no need to store the difference when you can calculate it so easily in a query or on a form or report. Just use DateDiff().
 

bretch

Registered User.
Local time
Today, 21:48
Joined
May 19, 2003
Messages
17
thanks Pat,

it worked on forms and reports.
Just curious about it, is it possible to store the difference in a third field? how

bregs:)
 

namliam

The Mailman - AWF VIP
Local time
Today, 15:48
Joined
Aug 11, 2003
Messages
11,695
As a general rule NEVER store calculated values.....

Regards
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:48
Joined
Feb 19, 2002
Messages
43,522
Of course it's possible. You can update the calculated field's value in the BeforeUpdate event of a form or your can run an update query. Neither method is recommended.
 

bretch

Registered User.
Local time
Today, 21:48
Joined
May 19, 2003
Messages
17
pat & namliam,

thanks for the inputs.....

:cool:
 

Users who are viewing this thread

Top Bottom