HHHHHHHHHHEEEEEEEEELLLLLLLLPPPPPPPP

R

RITRAM

I have a problem with my Access program. The problem is that I would like
took calculate time differential and i do not know how to do it. I wrote in a
query this formula and did not work:

New Time: [TIME]-[PREVTIME]

It gave me an error... I need help on this urgently.
 
T

Tim Ferguson

I have a problem with my Access program. The problem is that I would
like took calculate time differential and i do not know how to do it.
I wrote in a query this formula and did not work:

New Time: [TIME]-[PREVTIME]

It gave me an error... I need help on this urgently.

You only need to post once: and using a subject heading that related to
the actual query does help. Anyway, here we go.. :)

There are a number of possible problems here.

Firstly, can I assume that [Time] and Prevtime are DateTime values? If
so, then it is possible to subtract them like this, but you must be aware
that they are calculate in units of days, so you need to multiply by 24
to get hours and so on. For handier manipulation, look up the DateDiff
function, and use DateDiff("m", [Time], PrevTime) for example.

Second, the use of "Time" for a column name is a bug waiting to happen.
It's a reserved word in vba, and probably in sql too. Try using ThisTime
to match PrevTime, for example.

Thirdly, it's probably legal to use a space in a column name ("New Time")
but it's not sensible. Try "NewTime" or "Duration" or something.

If this does not help, then post back and let us know what the error is
-- what exactly is not working?

B Wishes


Tim F
 

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