473,396 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Auto incrementing date

How can I auto increment date in MS Access.
I have a form in which I collect following data
Range: From >> to
Start Date:

Now I wish to populate/append a table after I specify the start date and range For example if I specify range from 9 to 15 and give start date 24/10/2007 I wish the table to populate as-

No Date
9 24/10/2007
10 25/10/2007
11 26/10/2007
...
...
15 30/10/2007

How to DO it MS Access
Oct 24 '07 #1
3 4157
NeoPa
32,556 Expert Mod 16PB
You will need to process this using a RecordSet in VBA code.
SQL (queries) tends to work on existing data and as you have no existing data that can help, you'll need to use the code. If, for instance, you wanted to create records exactly 1 week forward from your existing records (or a subset of them) you could handle it in SQL but that's because the requirement is relative to existing data.
In your code have a loop which increments the data value then create a record in the table for each one.
Oct 24 '07 #2
Thanks for the reply. However I already have data and I wish to do this through SQL. Infact I am able to generate a table with

8 21/10/2007
9 21/10/2007 but i wish it to be 22/10/2007
10 21/10/2007 23/10/2007
...
...

I am unable to write proper SQL for this
Oct 24 '07 #3
NeoPa
32,556 Expert Mod 16PB
You will need to process this using a RecordSet in VBA code.
SQL (queries) tends to work on existing data and as you have no existing data that can help, you'll need to use the code. If, for instance, you wanted to create records exactly 1 week forward from your existing records (or a subset of them) you could handle it in SQL but that's because the requirement is relative to existing data.
In your code have a loop which increments the data value then create a record in the table for each one.
The explanation of why the first sentence is true is merely that. An explanation. It seems you are having difficulty following that but it doesn't matter. Just go by the first sentence. The second paragraph explains how you need to start going about it.
Oct 25 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Earl Anderson | last post by:
KB Article Q140908 provided the following function to create an Auto Incrementing Counter: Function Next_Custom_Counter () On Error GoTo Next_Custom_Counter_Err Dim MyDB As Database Dim...
16
by: John Baker | last post by:
Hi: I know this is a strange question, but I have inherited a system where files are copied and records re auto numbered (as an index field) )frequently, and I am wondering how high the number...
6
by: Alpha | last post by:
I retrieve a table with only 2 columns. One is a auto-generated primary key column and the 2nd is a string. When I add a new row to the dataset to be updated back to the database. What should I...
1
by: John | last post by:
Hi I am using Application.ProductVersion.ToString to get the app build number but the problem is that it does not auto increment. I have even replaced the content of AssemblyInfo.vb file from a...
7
by: Stinky Pete | last post by:
Hi, The db that's used as our corporate non conformace register, uses a NCF numbering system based on yy-xxxx. The yy is calculated using the year (sorry seems a bit obvious) and the xxxx bit...
6
by: luanhoxung | last post by:
hi all ! I have a text field with contruction: 0001-COM. I need to it automatically increase 0002-COM when add new record and ..... Any help with appreciated. Luan
12
by: badvoc | last post by:
Hi, I have had some good fortune on this site so I am back and I must iterate I am a beginer. I am having some problems getting to grips with the right technique to manage variables and...
13
by: BobLewiston | last post by:
Using Visual C# 2008 Express and SQL Server 2008 Express, I would like to insert new records into database "AdventureWorks", table "Person.Contact". To my surprise, this table's int-value identity...
1
by: disney86 | last post by:
I am setting up Forms in Access 08. I have a form which when opened will auto insert the current time and current date. I need to be able to allow the user to set up paramaters to auto select a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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,...

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.