473,401 Members | 2,125 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,401 software developers and data experts.

How do i confirm sequential numbers over multiple tables

33
Hi,
Using MS Access, '97, we have 4 tables in scope, the content of which is provided by a customer. I need to validate the data in all four tables and one validation routine is focused on a field named ORNO which exists in each of the tables.

The following examples show the content of the ORNO field
Table1.ORNO value '0012769'
Table 1 will only ever have one single record and the ORNO value must be numeric.

Table2.ORNO value '0012770','0012771','0012772'
Table 2 values must increment the value from table 1 by 1

Table3.ORNO value '0012770', '0012770','0012771','0012772'
Table 3 values must exist with Table 2 and there can be multiple instances of Table 2 ORNO values within Table 3.

Table4.ORNO value '0012772'
Table 4 will only have one record and it should be the highest ORNO value that exists in Table 2 and Table 3.


Appreciate any help with this,
Tks.


fields holds an order numberof which within each table a numeric field named ORNO exists.
Aug 7 '12 #1

✓ answered by twinnyfo

Quizzed,

It just depends on how you are adding data to your database. If you access your Excel Spreadsheet as a linked table, you could create a recordset based on that spreadsheet, then access those records sequentially. The easiest way to go sequentially for ORNO would be to maintain that variable, and add one to it every time you append a new record.

Is the value for ORNO already establishe din the Excel spreadsheet or is it generated by the DB? The "necessity" of having sequential records is not really a necessity unless it is out of preference. As long as the tables are related by that common field, things whould work well with an autonumber field, which is commonly used as a Primary Key. Please explain if there is something I am missing.

7 1661
twinnyfo
3,653 Expert Mod 2GB
Quizzed,

I have some questions first. The way you display your "numeric" values, with leading zeroes, it appears that your values are of text data type, rather than a number (like an integer or long integer). If this is the case, this could get quite challenging when "adding a number" to a text field. If you need to maintain a certain number of characters for a serial number, then there are ways to display the number with leading zeroes, without actually changing the content of the field.

Second, from a technical aspect, it is highly irregular that you would have two tables with only one record each in them, especially since they appear to be only place holders. This can easily be done with global variables. For example, Table4 could be replaced by a global vaiable MaxORNO, which would be determined whenever necessary by finding the maximum value of ORNO in Table2:

Expand|Select|Wrap|Line Numbers
  1. MaxORNO = DMax("[ORNO]", "Table2")
  2.  
I can only presume that the value of ORNO in Table1 is a similarly calculated value. This will clean up your DB.

However, please don't take offense to this, but concerning this post, I found no real "question" being asked, so I am not sure what help you need from this forum. I will be glad to address any specific issues and try to get you on the right track with this.
Aug 7 '12 #2
Quizzed
33
Tks Twinnyfo,
The data is provided in xls format for loading into the db, assuming i can get the source data format for ORNO to be Integer/Long, what would solution would you suggest to ensure that the ORNO value increments by a value of 1 for each record in Table2?
Aug 7 '12 #3
twinnyfo
3,653 Expert Mod 2GB
Quizzed,

It just depends on how you are adding data to your database. If you access your Excel Spreadsheet as a linked table, you could create a recordset based on that spreadsheet, then access those records sequentially. The easiest way to go sequentially for ORNO would be to maintain that variable, and add one to it every time you append a new record.

Is the value for ORNO already establishe din the Excel spreadsheet or is it generated by the DB? The "necessity" of having sequential records is not really a necessity unless it is out of preference. As long as the tables are related by that common field, things whould work well with an autonumber field, which is commonly used as a Primary Key. Please explain if there is something I am missing.
Aug 7 '12 #4
Quizzed
33
Yes the ORNO value is already established in the xls and yes it must be sequential.
These are order header references in Table 2, the order lines are related by the corresponding ORNO presented in Table 3.
Cheers for your time.
Aug 7 '12 #5
Quizzed
33
Twinnyfo, Yes the ORNO value is already established in the xls and yes it must be sequential.
These are order header references in Table 2, the order lines are related by the corresponding ORNO presented in Table 3.
Cheers for your time.
Aug 7 '12 #6
twinnyfo
3,653 Expert Mod 2GB
Well, if the ORNO is already in the spreasheet, what happens if they are NOT sequential? Do you have to establish an ORNO that is sequential? I'm not sure I follow how the database will have to modify the data....

I'm still not sure what you are trying to do. It sounds like a straight import.....
Aug 7 '12 #7
zmbd
5,501 Expert Mod 4TB
@Quizzed

This sounds like a compsci homework project...

Can you provide us with the code you've already developed to solve the issue? (what have you tried)

-z
Aug 7 '12 #8

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

Similar topics

1
by: E Arredondo | last post by:
Hi, I am about migrate from an old program database to MySql (Running under RH LINUX)and I'm wondering which is the best option to do : I currently have one file for each of my modules, (I'm...
2
by: Tony Williams | last post by:
I recently posted a message asking for help with sequential numbers. I want to create an autonnumber reference number that reverts back to 1 at the start of each year. GlenAppleton gave me some...
14
by: amywolfie | last post by:
Hi All: I know this is simple, but I just can't seem to get there: I need to sort a table by a text field (txtDescription), then assign sequential numbers to the field SEQUENCE in table. ...
1
by: Ahmet Karaca | last post by:
Hi. myds.Reset(); mycommand.SelectCommand.CommandText= "Select att1 from Ing as Ingredient, Pro as Product "+ "where Pro.ad='apple' and Pro.id=Ing.id"; mycommand.Fill(myds, "Product"); // Here...
1
by: John | last post by:
Hello, We are developing an application against an MS SQL Server 2000 database which requires that we implement full-text searching across columns in multiple tables. The research that we have...
3
by: Finomosec | last post by:
Hi, i have a table of number-objects with beginning and endnr: 10-15 16-20 25-30 32-32 35-35 36-36 37-40
12
daniel aristidou
by: daniel aristidou | last post by:
hi i was wondering if it is possible to filter multiple numbers of tables at the same time. the filter would be automatically applied ie. as in a query. However i want only one list to appear...
4
by: dstorms | last post by:
I'm trying to run an update query on multiple tables, and since Access doesn't allow me to update tables from a union query, I'm writing a module as a workaround. So I've set up a temporary recordest...
3
by: Excel 009 | last post by:
Hi, Is there a way to populate sequential numbers in a field using SQL or VBA? If yes, how? Assume the following is my existing table: Fruit ID Apply Banana
18
by: Joel Miller | last post by:
I found an article that was somewhat like what I was trying to do. The article was titled: SQL Query - Find block of sequential numbers Here is the article...
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: 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
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
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.