Solved

Access Database - Manually changing xid value

Posted on 2016-10-08
7
71 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 20
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 20
ID: 41835030
is xid AutoNumber? what is the data type?
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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 20

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 20
ID: 41835844
you're welcome ~ happy to help
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 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