How to do calculations in access

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
 
K

KC-Mass

Hi Seema,

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

InitiationTime: DateReceived - DateSent

Regards

Kevin
 
J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top