Datediff - make results permanent in table?

G

Guest

Hi,

I'm missing something really basic, I just can't figure out what. I need to
calculate the difference in time between 2 fields. I've figured out the
formula:

DateDiff("s",[SiteData]![TranscriptionDate],[BirdData]![Autotime])

and it works great when I place the expression under 'Field' in a select
query - the answers all appear as they should when I run the query. But I
need the answers to be pasted permanently in a field in the table, which a
select query won't do. I've tried update queries, but I can't figure out how
to make the results of the calculations appear in the table. I need to do
subsequent calculations on the answers to the first calculation, so I need
them to appear in the table.

If you can be explicit with your answer that would be great - i.e. where to
place the above formula, in what type of query, if I'm missing any operators,
etc.

Thanks!
Theresa
 
D

Duane Hookom

If you really think you need to store a value that can be calculated (rarely
necessary), use an update query. You query must be updateable. It is
impossible to tell what your query SQL might be or what issues you had when
you attempted this.

Do you have some table and field names to share as well as the primary and
foreign keys if more than one table is involved?
 
T

Tom Ellison

Dear Theresa:

First, it is almost always a bad thing to store derivable values. Just
derive them when you need them.

If you insist on storing it, take the existing SELECT query and have it
transformed into an UPDATE. Then select the destination column for this
calculated value.

Tom Ellison
 
G

Guest

Thanks to both of you - it worked great. I understand the risks of storing
the derived values...but honestly, it's necessary. But I'll file away the
warning for future reference.

Cheers,
Theresa
 

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

Similar Threads

Append Query with relational databases? 7
No results using DateDiff 5
DateDiff with variable criteria? 3
Access DateDiff function 0
Can't query DateDiff 3
DateDiff results 5
Help with DateDiff 2
DateDiff 5

Top