By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,148 Members | 759 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,148 IT Pros & Developers. It's quick & easy.

Automatically Increment Time?

P: n/a
Please write suggestions on how to automatically increment time in a
field (table or query).

Example:

Name | Time
John Doe | 11:00 AM
Jane Doe | 11:08 AM (8 minutes later)
Jim Doe | 11:16 AM (8 minutes later)

and so on...

It would be quite tedious to manually add times for each person when
this is something a computer could easily calculate.

Thanks for your suggestions. :)
Nov 12 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On 7 Jan 2004 09:16:29 -0800, go****@trumpetjazz.com (Bobby) wrote:
Please write suggestions on how to automatically increment time in a
field (table or query).

Example:

Name | Time
John Doe | 11:00 AM
Jane Doe | 11:08 AM (8 minutes later)
Jim Doe | 11:16 AM (8 minutes later)

and so on...

It would be quite tedious to manually add times for each person when
this is something a computer could easily calculate.

Thanks for your suggestions. :)


I'm not sure what you are doing, but take a look at DateAdd
function...

?dateadd("n",8,now())
1/7/2004 3:49:51 PM

- Jim
Nov 12 '05 #2

P: n/a
go****@trumpetjazz.com (Bobby) wrote in message news:<18**************************@posting.google. com>...
Please write suggestions on how to automatically increment time in a
field (table or query).

Example:

Name | Time
John Doe | 11:00 AM
Jane Doe | 11:08 AM (8 minutes later)
Jim Doe | 11:16 AM (8 minutes later)

and so on...

It would be quite tedious to manually add times for each person when
this is something a computer could easily calculate.

Thanks for your suggestions. :)


I agree with the other response... could you explain EXACTLY what you
want? Do you mean that you're intending to update a bunch of records
or to create new ones? If this is something like an appointment
system where "patients" have appointments every 8 minutes or whatever,
then this is easy. You could just do this in code and increment your
appointmentTime by 8 minutes each time. Then use a recordset to
insert the records into a table.
Nov 12 '05 #3

P: n/a
go****@trumpetjazz.com (Bobby) wrote in message news:<18**************************@posting.google. com>...
Please write suggestions on how to automatically increment time in a
field (table or query).

Name | Time
John Doe | 11:00 AM
Jane Doe | 11:08 AM (8 minutes later)
Jim Doe | 11:16 AM (8 minutes later)


Are these data entry times in a table? If so, in your date/time
field, set the DefaultValue property in the table to Now(). Then, if
you want to display it in a form as only time, set it to "Mediuim
Time" and you'll get the display as above.

If that's not what you're saying, then please explain further.

Thanks,
Anthony.
Nov 12 '05 #4

P: n/a
Thank you all!

These are appointments that last the same amount of minutes for each
person.

Actually, the people have already been entered and sorted randomly
into the table using the random increment feature. Now they need to be
assigned 8 minute slots.

I'll experiment with the DateAdd function.

Thanks again!
Nov 12 '05 #5

P: n/a
"Jim Allensworth" <ji****@Notdatacentricsolutions.com> wrote
I'm not sure what you are doing, but take a look at DateAdd
function...

?dateadd("n",8,now())
1/7/2004 3:49:51 PM

- Jim

For each record, I need to add 8 minutes to the time in the previous
field and place it in the current field.

Can DateAdd() do this, or is there another way I can think of the same
thing?
Nov 12 '05 #6

P: n/a
On 8 Jan 2004 10:29:34 -0800, go****@trumpetjazz.com (Bobby) wrote:
"Jim Allensworth" <ji****@Notdatacentricsolutions.com> wrote
I'm not sure what you are doing, but take a look at DateAdd
function...

?dateadd("n",8,now())
1/7/2004 3:49:51 PM

- Jim

For each record, I need to add 8 minutes to the time in the previous
field and place it in the current field.

Can DateAdd() do this, or is there another way I can think of the same
thing?


Bobby, a couple of thoughts:
If the increment is always 8 minutes then you have no need to store
it.
If you are backfilling some data then yes you could use DateAdd to
accomplish that.
When you say "add 8 minutes to the time in the previous field" do you
mean last field or previous record?

At any rate DateAdd should do the trick.

- Jim
Nov 12 '05 #7

P: n/a
"Bobby" <go****@trumpetjazz.com> wrote in message
news:18**************************@posting.google.c om...
"Jim Allensworth" <ji****@Notdatacentricsolutions.com> wrote
I'm not sure what you are doing, but take a look at DateAdd
function...

?dateadd("n",8,now())
1/7/2004 3:49:51 PM

- Jim

For each record, I need to add 8 minutes to the time in the previous
field and place it in the current field.

Can DateAdd() do this, or is there another way I can think of the same
thing?


If you are using DAO...

Dim MyDb as Database
Dim MyRS as Recordset
Dim DateSeed as Date

Set MyDB = CurrentDB
Set MyRS = MyDB.OpenRecordset("YourTable",dbOpenDynaset)
DateSeed = YourFirstDateTimeValue

Do Until MyRS.EOF = True
MyRS.Edit
MyRS!YourDateField = DateSeed
MyRS.Update
DateSeed = DateAdd("n",8,DateSeed)
MyRS/MoveNext
Loop

MyRS.Close
Set MyRS = Nothing
Set MyDB = Nothing

(above should have appropriate Error Handling added)
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.