473,672 Members | 2,450 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automatically Increment Time?

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
7 3345
On 7 Jan 2004 09:16:29 -0800, go****@trumpetj azz.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
go****@trumpetj azz.com (Bobby) wrote in message news:<18******* *************** ****@posting.go ogle.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
go****@trumpetj azz.com (Bobby) wrote in message news:<18******* *************** ****@posting.go ogle.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
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
"Jim Allensworth" <ji****@Notdata centricsolution s.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
On 8 Jan 2004 10:29:34 -0800, go****@trumpetj azz.com (Bobby) wrote:
"Jim Allensworth" <ji****@Notdata centricsolution s.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
"Bobby" <go****@trumpet jazz.com> wrote in message
news:18******** *************** ***@posting.goo gle.com...
"Jim Allensworth" <ji****@Notdata centricsolution s.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.OpenRecord set("YourTable" ,dbOpenDynaset)
DateSeed = YourFirstDateTi meValue

Do Until MyRS.EOF = True
MyRS.Edit
MyRS!YourDateFi eld = DateSeed
MyRS.Update
DateSeed = DateAdd("n",8,D ateSeed)
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4847
by: Randell D. | last post by:
Folks, I have a table of addresses and a seperate table with contact names - All addresses tie to one or more names - I would like to keep track of the number of names 'belonging' to an address and have thus included a column in my address table called num_of_contacts. Everytime I add a new contact, I would like to increment the num_of_contacts column in the address table. Is this possible?
2
5773
by: Targa | last post by:
I have a form field which displays a time in the format 5:30 PM - this time is selected from a previous page. I need to add a function to increment or deincrement the time by clicking up/down buttons - sort of like the clock in Windows. How can this be done in javascript? Thanks in advance!
8
2915
by: Bob Altman | last post by:
Hi all, Is there any way in an unmanaged C++ project to have the FILEVERSION property in the version resource automatically get a larger value each time I rebuild my project?
3
2736
by: George Ter-Saakov | last post by:
What is the purpose of having Interlocked.Increment if it does not work with variable declared as volatile. Here is my problem, Interlocked.Increment increments the variable in thread safe manner. But at the same time if i want to use variable that could be changed in another thread i must use volatile (to prevent optimization). But then i can not use Interlocked.Increment. So i do not see any benefits of having ...
2
5536
by: john | last post by:
Is it true that if I split my access database in backend and frontend and I implement custom auto increment for the ID fields, that my database is ready to be used in a multi-user environment? I found a zillion messages about auto increment and read some of them but it's confusing. Can someone point me to a simple custom auto increment example that I can download? Thank you, john
2
3276
by: vidhyapriya | last post by:
how to increment 4 digit number automatically in vb.net windows appln for example: dc0001-----this is first userid next time i click new button the user id automatically increased to dc0002 likewise anybody to help me
0
1116
by: vidhyapriya | last post by:
how to increment 4 digit number automatically in vb.net windows appln for example: dc0001-----this is first userid next time i click new button the user id automatically increased to dc0002 likewise i need the format format 0001...if user id 99 the format should be 0099...
2
1792
by: dkhansoft | last post by:
hi, i have created one table called user_details for this table there is one column called uid,which should increment automatically,when ever i insert values for this i have create table by using auto_increment,table created seccussfully, bt if i insert values into this table by excluding tat uid(which is increment automatically),it is showing error column count doesnt match value of row count. anybody knows where i was error, ur...
8
2082
by: bintom | last post by:
Why doe the following C++ code behaves as it does? int i; i=1; cout << (++i)++; Output: 2 i=1; cout << ++(++i); Output: 3 i=1; cout << (i++)++; Output: Error. LValue required i=1; cout << ++(i++); Output: Error. LValue required
0
8486
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8406
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8831
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8609
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8683
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7449
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.