Solved

Access Database - Manually changing xid value

Posted on 2016-10-08
7
77 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 21
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 21
ID: 41835030
is xid AutoNumber? what is the data type?
0
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 

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 21

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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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