TIME QUERY

H

Harold Ducote

I have a field called nowTime and one called timeon

nowtime field is setup as Date/Time and
timeon as a number

example
nowtime timeon
1/12/2004 2:40:00 PM 60
1/12/2004 2:50:00 PM 120

what I need to figure out is how to run a cal query where it will add
nowtime + timeon and give me time
so the answer will be

1/12/2004 2:41:00 pm.
1/12/2004 2:52:00 pm

the timeone field is a counter on how many seconds a users been in a file.

any ideas would be helpful.



Harold Ducote
(e-mail address removed)
Frank's Casing Crew
Info Resources Coordinator
337-572-2313 phone
337-572-2462 fax
"If you really want to do something,
you'll find a way;
If you don't, you'll find an excuse."
 
G

Guest

-----Original Message-----
I have a field called nowTime and one called timeon

nowtime field is setup as Date/Time and
timeon as a number

example
nowtime timeon
1/12/2004 2:40:00 PM 60
1/12/2004 2:50:00 PM 120

what I need to figure out is how to run a cal query where it will add
nowtime + timeon and give me time
so the answer will be

1/12/2004 2:41:00 pm.
1/12/2004 2:52:00 pm

the timeone field is a counter on how many seconds a users been in a file.

any ideas would be helpful.



Harold Ducote
(e-mail address removed)
Frank's Casing Crew
Info Resources Coordinator
337-572-2313 phone
337-572-2462 fax
"If you really want to do something,
you'll find a way;
If you don't, you'll find an excuse."

.

I think you want the built-in function DateAdd. Look it
up in the Help, but you can ask it to add seconds on, by
putting "s" as the first argument, eg:

DateAdd("s",1,Now())


Hope that helps.


Damien
 
H

Harold Ducote

how do i put this i a query format?


Harold Ducote
(e-mail address removed)
Frank's Casing Crew
Info Resources Coordinator
337-572-2313 phone
337-572-2462 fax
"If you really want to do something,
you'll find a way;
If you don't, you'll find an excuse."

-----Original Message-----
I have a field called nowTime and one called timeon

nowtime field is setup as Date/Time and
timeon as a number

example
nowtime timeon
1/12/2004 2:40:00 PM 60
1/12/2004 2:50:00 PM 120

what I need to figure out is how to run a cal query where it will add
nowtime + timeon and give me time
so the answer will be

1/12/2004 2:41:00 pm.
1/12/2004 2:52:00 pm

the timeone field is a counter on how many seconds a users been in a file.

any ideas would be helpful.



Harold Ducote
(e-mail address removed)
Frank's Casing Crew
Info Resources Coordinator
337-572-2313 phone
337-572-2462 fax
"If you really want to do something,
you'll find a way;
If you don't, you'll find an excuse."

.

I think you want the built-in function DateAdd. Look it
up in the Help, but you can ask it to add seconds on, by
putting "s" as the first argument, eg:

DateAdd("s",1,Now())


Hope that helps.


Damien
 
G

Gary Walter

Hi Harold,

DateAdd(interval, number, date)

Damien was just demonstrating adding
1 second to what ever time it is now.
DateAdd("s",1,Now())

But you want to add "timeon" seconds
to your "nowtime" field, so your query
might look like:

SELECT
nowtime,
timeon,
DateAdd("s", [timeon], [nowtime]) AS Calc
FROM
nameofyourtable;
 
H

Harold Ducote

thanks that worked out just right.

Harold Ducote
(e-mail address removed)
Frank's Casing Crew
Info Resources Coordinator
337-572-2313 phone
337-572-2462 fax
"If you really want to do something,
you'll find a way;
If you don't, you'll find an excuse."

Hi Harold,

DateAdd(interval, number, date)

Damien was just demonstrating adding
1 second to what ever time it is now.
DateAdd("s",1,Now())

But you want to add "timeon" seconds
to your "nowtime" field, so your query
might look like:

SELECT
nowtime,
timeon,
DateAdd("s", [timeon], [nowtime]) AS Calc
FROM
nameofyourtable;
 

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


Top