Solved

Access Database - Manually changing xid value

Posted on 2016-10-08
7
56 Views
Last Modified: 2016-10-09
Hi Experts

I have got an access database file which has got 2 tables in named Table A and Table B inside it. Both of them have got xid columns in them which gets created automatically, when data comes inside these tables from an external application.

Now the problem that I am facing is that there is a gap of One Day Data in the Table A, which I have to fill  by taking up the data for that same Day, from the Table B. All the columns in both the tables match perfectly, other then the xid value.

Please suggest me some method, by which I can pick up the data from Table B for date 25 May 2016, and INSERT that into the Table A, in the PROPER LOCATION, means that this data should automatically come in at the location or Row Number, where the data from the previous date of 24 May 2016 ENDS.

While doing this data import, I need to make sure that the xid column values gets modified appropriately and there are no duplicates xid values etc.

Is there some easy method to do such a thing ? Please provide some suggestions. If you need I can create a small sample database having both the tables and upload the same.

I am using the following software versions -
Microsoft SQL Server Management Studio version-  12.0.2000.8,
Microsoft Office 2016 x64
and Windows 7 x64

Thanks

PS: The main thing is that when I do the import into the Table A, then the data should go into proper location of row number that starts after the last row of 24 May 2016.
AND the xid column values should get updated automatically, so that there are no gaps or duplicates etc. in the overall xid column of Table A.
Any method which fulfills these 2 conditions, is fine for me.

I am ready for any methods, even if that involves deleting all the data from Table A, after date 24 May 2016, then importing the data of gap date 25 May 2016, and then importing back all the data for all the dates from 26 May 2016 onward. Although this method would be much more tedious, but if there is no other way, then I am ready for doing it, if that will solve the xid column sequence issue.
0
Comment
Question by:happy 1001
  • 4
  • 3
7 Comments
 
LVL 19
ID: 41835014
assuming xid is an AutoNumber, you are not allowed to change its values.  Better to sort by data in the table.

To find MISSING data, you need to compare against a list that has all the data. When do your dates start? How long will they continue? Is there (/supposed to be) one record for each day?

Why is information going into 2 tables? Is this information already imported and not something that will change in the future?
0
 

Author Comment

by:happy 1001
ID: 41835028
Thanks for your reply.

I already have the data that is missing from Table A, into the Table B for the date of 25 May 2016. The problem is that this data has got different xid values for that data.

I need to import it into Table A, at the right place, after 24 May 2016, and somehow correct the xid column values into it.

Looking for a way, by which xid values can be changed in this manner. Any ideas are welcome.
0
 
LVL 19
ID: 41835030
is xid AutoNumber? what is the data type?
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:happy 1001
ID: 41835112
Yes, your assumption is Correct. xid is AutoNumber. In Data Type it also says AutoNumber. It is like this -
56063
56064
56065
and so on

Thanks and regards
0
 
LVL 19

Accepted Solution

by:
crystal (strive4peace) - Microsoft MVP, Access earned 500 total points
ID: 41835173
if there will be no more records added, then you can change AutoNumber to Long Integer data type.  If it stays AutoNumber, its values canNOT be changed.

The purpose of an AutoNumber is a unique identifier.  If you want the sort order to be different, you should use another field(s) to do that.
0
 

Author Comment

by:happy 1001
ID: 41835759
Thank you crystal.
0
 
LVL 19
ID: 41835844
you're welcome ~ happy to help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Creating and Managing Databases with phpMyAdmin in cPanel.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now