Solved

Access Database - Manually changing xid value

Posted on 2016-10-08
7
44 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

757 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

19 Experts available now in Live!

Get 1:1 Help Now