Replaced table doesn't seem to disappear

baseball

Board Regular
Joined
Apr 1, 2002
Messages
153
Access 2007 on Win 7

Have DB with five years of play-by-play data for baseball but suddenly realized totals weren't correct. Checked years individually and learned that the errors came from 2013 and 2014. Downloaded raw data again and converted it to comma-delimited form, then joined the header file with five csv's with CMD prompt. Saved it to my existing data base with a new table name, deleted previous table, and then renamed new table with old table's name (to avoid having to change a ton of queries). I get the same errors.

Next, I made a table with just the 2014 data and got the correct totals. It's like the original table has never disappeared and I don't understand why. Since I have several decades of data following a specific naming scheme and I have a lot of queries, is there some way I can avoid renaming DBs, tables or rewriting many queries?

Thanks,
Cliff
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Are your data tables inherent in Access (i.e. are you physically importing the data into Access), or are you data tables linked files?

If the data does reside in Access, I find the easiest way is instead of deleting/renaming tables, leave the table structure intact as it is. Simply delete the data you do not want out of it, then import the new data into that table. Then you don't have to worry about messing with Queries and other objects.
 
Upvote 0
I stumbled across the solution. My table was fine but my Roster table contains errors in that it lists people who go by initials instead of first names were showing up as both JR and J.R., so they got double-counted. Ordinarily, I just go by the playerID code but in this case I wanted to associate names with them and I finally realized that I was getting an answer of 4186 when I simply queried with the playerID but 4202 when I added the Roster table to the query. Once the two queries were sorted by playerID instead of gameID I picked out the problem. But thanks for taking time. It at least got me on a different path.

Cliff
 
Upvote 0
Just keep my advice in mind, as if it ever comes up again in the future, it isn't necessary to mess around with adding/deleting/renaming tables. It is easier just to delete the data you want out of the table and import data into that same table.
 
Upvote 0
I'll bear it in mind but it might be easier said than done with my data as I would have had to delete nearly 200,000 records, which don't necessarily have different identifiers. For example, they are arranged by gameID, which is made up of three letters identifying the home team, followed by yyymmddg, e.g., ANA201404220. Would a Delete query remove all records where I tell it that gameID is Like *2014*?
 
Upvote 0
Would a Delete query remove all records where I tell it that gameID is Like *2014*?
That should be able to be done.

Also, if the year always appears in the same place of that identifier (i.e. starting in space 4), you could write an equation to pull just that year out and use that in your criteria.
 
Upvote 0
Thanks, I'll keep all this in mind if I ever again need to delete and replace data in a table.
 
Upvote 0

Forum statistics

Threads
1,221,899
Messages
6,162,682
Members
451,782
Latest member
LizN

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top