View Single Post
  #8  
Old January 18th, 2005, 07:55 PM
pvdalen
external usenet poster
 
Posts: n/a
Default

Hey John,

Just wanted to let you know you convinced me. I removed the "Hours" field
in the database and now emply calculatons where I need them. I think I
balked initially at that solution, because I have separate date and time
fields, and it seemed like a pain in the ass, but simple concatenation worked
fine.

Thanks again, John. You're always a big help.

Paul

"John Vinson" wrote:

On Sat, 18 Sep 2004 08:32:34 -0700, "Paul"
wrote:

Hi gang,

I've already been he

http://www.mvps.org/access/datetime/date0004.htm

I have 2 time fields, "Time In" and "Time Out". I have a
third field, a number field, that is to receive a
difference of the 2. Like I said, I tried the expression
from the link above and got this error:

"The database engine does not recognize either the
field "Time In" in a validation expression, or the
default value in the table "Task" "


Reread the explanation on the website.

You cannot and should not store this time difference in a Table - *at
all*.

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 redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps