How to do calculations in access

  • Thread starter Thread starter Seema
  • Start date Start date
S

Seema

i am new to access.I am working on designing queries. I am using only one
table. I would like to do the following calculations

Initiation time=Date mail received minus date email sent.

The date mail received and date mail sent are fields in the table. How can I
return the results of these calaculation and get the results in a new field
called "Initation time"

Please help as I am working on a project
 
Hi Seema,

In the query panel you will put in the Field line an expression like:

InitiationTime: DateReceived - DateSent

Regards

Kevin
 
The date mail received and date mail sent are fields in the table. How can I
return the results of these calaculation and get the results in a new field
called "Initation time"

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just store the date sent and date received fields in your Table. In a Query
you can put a calculated field by typing

Initiation time: DateDiff("d", [Date sent], [Date received])

in a vacant Field cell. See the VBA help for DateDiff - it gives you the
choice of any time interval from seconds to years.
 
Back
Top