Queries :: Renaming Fields From One Table Value To Another

Mar 6, 2015

I want to automate a find and replace process to standardize names in a table, using the value from one table to replace another. The code I have is not quite working.

Background:
- Table [Checking] field [Description] has the source text field that I like to change/standardize
- Table [Rename] field [Description] has the text string used to search the [Checking].[Description] values. The search should contain wildcard logic so e.g. a [Rename].[Description] value of "Mobil" would find a [Checking].[Description] value of "Mobil 123", or "Mobil 234", or "Mobil123456 AB".
- Table [Rename] field [NewDescription] is the new value used. If [NewDescription] = "Mobilx", then the "Mobil 123", or "Mobil 234", or "Mobil123456 AB" would all be changed to "Mobilx".

I have the following code which partially works:

UPDATE checking, rename SET [Checking].[Description] = [Rename].[NewDescription]
WHERE ((([Checking].[Description]) like "*" & [Rename].[Description] &"*") );

Problem is the original [Checking].[Description] value is not deleted in full so the replacement [Checking].[NewDescription] value is not correct.

e.g. "Mobil12345 AB" might be changed to "Mobilx AB" instead of "Mobilx" (some of the original string remains).

View Replies


ADVERTISEMENT

Renaming Table Names

Jan 4, 2008

Hellow,

Little question, hopefully not a big answer :)

i have four oracle db'ses mydb_db_test, mydb_db_production, mydb_db_develop

within access i have linked tables from the first one; let's say: mydb_db_test.tblOne, mydb_db_test.tblTwo

What i want to do is:
1) import the same tables from the other trhee db'ses
2) rename the table names by vba code
example: my_db_db_test.tblOne has to become tblOne
and when i switch from db (to for example the production), the tblOne has to be renamed originally (mydb_db_test.tblOne) and the other has to be renamed (so mydb_db_production.tblOne becomes tblOne).

Now the question which you probably ask me:
Why not by a connection string change...

Well, that's the problem, the linked tables are being set to readonly, and the property cannot be changed (at least, as far as i tried); so that's why i thought of this workaround. By linking all three databases, i also always have for those table the three connection strings, and by renaming them (i now do this manually) i always can pick the right connection.

Thanks in advance for the advise!

View 3 Replies View Related

Renaming A Filed In A Table

Jan 4, 2007

I have a table Client-Details,in which i have a record namely "bharti-chennai".this table is associated with aother table "release-details". bharti-chennai has records in relase details.i want to change the name of bharti-chennai to bharti -mumbai ..how to do it.

View 2 Replies View Related

General :: Renaming Tables / Queries Using Navigation Pane

Feb 6, 2014

I understand the principle of renaming the above of using the navigation pane and selecting the object but what is happening in my case is that when I select the specific table/query I wish to rename, the text is highlighted as per normal but the instant I move the cursor onto that cell that whole panel highlights in red and then reverts back to the original state of just the text in that panel (now highlighted).

I do not know if this is related to the problem but I have a text box with the "code" =Count([tblEntries].[CageNo]).

This was working perfectly okay but both this and the renaming appeared to happen about the same time. I have opened other Access files and the same re the renaming occurs. I have secure security running and do not think this could be the problem but anything is possible.

View 7 Replies View Related

Forms :: Get Date Create In Renaming Table

Jul 18, 2014

All, using access 2010. I have some code to rename a table in my database. Partial Code:

Code:
TableDefs("tblMstr").Name = "tblMstr" & Format(Date, "yyyymmdd")

This works but how do I use "datecreated" to get the creation date of the table and format it. I tried to use DateCreated in place of Date but get errors such as variable not defined or .datecreated without a with block.The result I'm going for is something like "tblMstr20140603".

View 5 Replies View Related

Renaming Column Headers In Pivot Table

Oct 24, 2014

I am in the process of developing a pivot table with grouping per month per year which works just fine. However, I would like to rename the column header items. It will not allow me.

The scenario:
the data is from a query that deprives data from two tables (Date from Table A) and (TypeID from Table B: Query will show TypeID in text format based on SELECT to show data in text format not numeric format).

The struggle:
Renaming the column headers which shows the TypeID in numbers based on its ID (the first column of Table B), not its Description (the second column of the Table B).

The question:
How do I make the column headers to show the TypeID in text based on its Description in the second column of the Table B?

View 1 Replies View Related

Modules & VBA :: Renaming Files Based On Records In A Table

Oct 16, 2014

Code to rename photos (Access 2010). The new name (full path) is listed on a table (although I would love to accomplish the task from the list query that I later used to generate the table). There is one field in the table (or query) called OldPath and one field called NewPath. The table name is RenPaths. Both paths are located in the same drive. I want to rename the file in a new folder. I created the new folder which is contained in the NewPath.

I was trying to accomplish this using the Name function

Name OldPath as NewPath

Here is the full code:

Private Sub Command0_Click()
Dim rs As DAO.Recordset
Dim db As DAO.Database
Dim OldPath As String
Dim NewPath As String
OldPath = "Select OldPath From RenPaths"

[Code] ....

Here is an example of the paths in my table:

Old Path is - C:UserskcrespoDocumentsFulcrum to MACPFulcrum_Export_a97dee97-ba92-455e-9d5c-3b35617ad357SAA Inspection Form367e14e0-439b-4a50-99e1-9154bcc9e3f7.jpg

New Path is - C:UserskcrespoDocumentsFulcrum to MACPFulcrum_Export_a97dee97-ba92-455e-9d5c-3b35617ad357SAA Inspection FormimageswwMH51856_A3f7.jpg

Im getting an error: Run time error '53': File not found

I checked the OldPath and everything is correct so if the code is working correctly it should have found the file.

View 3 Replies View Related

Queries :: Join Multiple Fields From One Table To Same Table In A Query

Nov 21, 2014

I have a table that is basically a survey form. The same series of options was available for 35 questions, and the table used to have a text string written for each answer. Because of all the repetitive data, I created a second table that assigned a number value to each of the nine possible options in these 35 separate fields. What happened is that, instead of the same text strings repeated over and over (and taking up real estate), now each of the 35 columns had a single number in them.

Now comes the day of reckoning and TPTB want a query with the raw data and the original text strings back in instead of the numbers. I was thinking doing something along the lines of a DLookup, but I can't seem to make that work in a query correctly. Apart from calling the same table and linking it over and over to the different fields in the original data table (see photo for how insane that is).

View 2 Replies View Related

Queries :: Update Table 1 Certain Fields Based On Table 2

Mar 9, 2015

I would like to achieve the following task described below:

Just for an example i have two tables = Table1 and Table2

Table1 contains following fields: ID , CusName, Price , Date_
Table2 Contains following fields: ID, CusName, Price, Date_

I would like to update Price and Date Field of Table 1 where Table 1 ID matching with Table 2 and Table 2 Date is maximum(most recent date).

View 4 Replies View Related

Queries :: Take Content Of Two Fields From One Table And Dump Into Other Table

Jun 27, 2013

I am trying to take the content of two fields from one table and dump them into the other table, I created an Append Query pulling up just the main table and appending to the destination table but it doesn't copy the info when I run it. I also pulled in both the tables (and yes they are joined) doing the same as above and still it doesn't do anything when I run it.

View 1 Replies View Related

Queries :: Deleting Fields Within A Table

Sep 16, 2014

Is it possible to create a query that will delete the fields within a table?

View 1 Replies View Related

Queries :: Calculate Fields Within Table

Dec 18, 2013

I am trying to calculate 5 fields within my table in a query, but for some reason some rows do not calculate as not all the fields contain a value (blank field), is there anyway that I could bypass this issue?

View 1 Replies View Related

Queries :: Update 3 Fields In Master Table

Feb 19, 2014

I'm having problems with an Update query. I have data coming in on one file that I am loading to a temp table that I want to update on another table in my database. The problem is that when I run my update query, it is wiping out everything that DOESN'T match. I have 5 fields that MUST be equal before the update can occur. I'm trying to update 3 fields in my "master" table.

Here is my SQL:

UPDATE NPPDcopy LEFT JOIN tempNPPD ON (NPPDcopy.Hour_Ending = tempNPPD.Hour_Ending) AND (NPPDcopy.TieLineName = tempNPPD.TieLineName) AND (NPPDcopy.AdjBalancingAuthority = tempNPPD.AdjBalancingAuthority) AND (NPPDcopy.BalancingAuthority = tempNPPD.BalancingAuthority) AND (NPPDcopy.OperatingDay = tempNPPD.OperatingDay) SET NPPDcopy.Import = [tempNPPD].[Import], NPPDcopy.Export = [tempNPPD].[Export], NPPDcopy.Net = [tempNPPD].[Net];

View 2 Replies View Related

Queries :: Searching Multi Fields In Table

Jun 23, 2014

i have a form with a control for "repair type" and a subform that has a query that searches a table holding vehicle repair records. on the form the user can enter up to 5 repair types, [repair1], [repair2], etc.. Then the control on the form holds each type of repair to search by. Since the user could use one or all five repair fields and put repair types likes brakes in field one on one record and field 5 on another record, how do i search to just pull out those records that have the specified search criteria?

If i put in [form]![control] in each of the 5 criteria in the query it comes back with no records, because it it looking for that type in every repair field rather than once between the five fields?

View 2 Replies View Related

Queries :: Make Table Query On Like Fields

Sep 18, 2013

I am developing a Make Table Query from 2 tables, one of which has an "Employee Name" field (lastname,firstname) and the other table has separate fields for LastName and FirstName. I've been able to accomplish almost what I need by:

WHERE ((([Table 1].[EMPLOYEE NAME]) Like [Table 2].[LAST NAME] & "*"));

Which works fine except when there are 2 employees having the same last name, then it generates duplicates. I suspect there must be a way to do this by incorporating the first name field in the sql statement but that's beyond my ability. I realize that names are not good things to base a query on, but the 2 existing tables have been preset and populated by others and I don't really have the capability to change them.

View 3 Replies View Related

Queries :: Fields Populated For Each Record From The Table

Nov 2, 2014

I have a table with multiple fields and each record in the table may not have data for all fields. I need to write a query that will pull only the fields that are populated for each record from the table.

View 1 Replies View Related

Queries :: Update Column Fields In Table

Jul 15, 2015

I have a table and I write a query to update some the coloum field.

The Scenario is as follows.

I want to compare two columns in an Access

UseCase UseCaseN
n/a n/a
UC UC1
migrated no value needed

That means the value in UseCase has to be copied to UsecaseN in all cases expect when the value in UseCase is Migrated ...

View 6 Replies View Related

Renaming Issue

Jun 20, 2005

Hi,

In Access 2003 when you rename a table any queries that the table is in will be renamed aswell, which is usually very useful.

However, is there a way to turn this property off, because I am trying to run over a hundred of the same query that use different tables? In Access 2000 I renamed the tables and used the same query, because it is much quicker, but I have just noticed that the data I am extracting is inaccurate, because when I undo the rename, the table names change in the query.

I will be very grateful for any help.

All the best,


Roly

View 1 Replies View Related

Renaming A Field

May 13, 2006

I have table with lot of fields, I would like to rename those fields, how do I do that using code or a query?

View 1 Replies View Related

Make Table Queries And Concatenated Memo Fields

Jul 13, 2006

I have a Make Table query that includes a new field concatenated from a numeric field and a memo field, with some assorted text elements -
Issue Description:"("&[number]&") "&[Description]

When I run the Make Table, the new field "Issue Description" is created as a text field, NOT as a memo field.

Is there any way to insure that this field is created as a memo field.

Thanks.

Susan

View 1 Replies View Related

Queries :: Show All Fields With No Matching Records - One Table

Aug 14, 2013

How to get the following results using 1 table:

Field1 ID is an auto record ID, field2 ID is actually field1 ID assigned that record, in other words record 1 has a roommate (record 5) assigned to it, record 2 has a roommate (record 4) assigned to it

Table A

Field1 ID Field2 ID
1 5
2 4
3 6
4 2
5 1
6 8

Results records I'm looking to display for would be:
1 5
2 4
3 6
6 8

I only want to display all fields for records, but I don't want to show their matching record, so I want to display record1, but not record 5 because record 1 has record 5 as a roommate, want to display record 2 but not record 4.

View 5 Replies View Related

Queries :: Adding Fields In A Table That Are Related To Other Tables

May 13, 2013

I am a beginner in access and I want to populate a new field (REPUN_1 which corresponds to SEGMT_ID in the other table) in my table and this field is coming from another table. The values of the fields need to correspond to the row of my actual table (JMTable) having the same CO_ID, MOVEPLANCD and TTY_NO as the table I want to extract the values from (DI_Treaty_Crosswalk).

Here is my query:

UPDATE JMTable SET [REPUN_1] = DI_Treaty_Crosswalk.SEGMT_ID WHERE JMTable.TTY_NO = DI_Treaty_Crosswalk.TTY_NO AND JMTable.CO_ID = DI_Treaty_Crosswalk.CO_ID AND JMTable.MOVEPLANCD = DI_Treaty_Crosswalk.MOVE_PLAN_CD

and it doesn't work since access ask me to enter a parameter value.

View 1 Replies View Related

Queries :: Update Fields Of One Table With Multiple Criteria

Aug 12, 2015

How can i update fields of one table with update query where creteria are more than one 1

Example:

DoCmd.RunSQL "UPDATE Salary2009toUpdate SET " & Me.Combo2 & "='" & Me.Text4 & "'
Where Empid='" & Me.Combo0 & "'" and where bank='" & Bankname & "'"

What is the syntax error ...

View 5 Replies View Related

Queries :: Create Table Query From Multiple Fields?

Aug 14, 2013

i essentially have 2 table:

1. Table BIC

A list of codes that will be updated monthly, which will be the basis for querying the second table. Approx 100 rows of data.

2. Table Original

A data file obtained from IT where i'll need to sort it to find any codes that are including in Table1. This includes approx ~ 10,000 row of data.

** note, the "BIC" from "Table BIC" can appear in any of the 5 BIC columns in Table Original.

What i need to do is create a query that will:

1. Search the "BIC" from "Table BIC" in all 5 columns of "Table Original".

2. Where it has a hit, it will create new table - for example, the first row of table Original includes the BIC "ABC" in the "BIC 1" column. A query would create table "ABC" and place this whole record (all 8 fields) in new table "ABC". No modification needed.

3. Where two (or more) BIC's from "Table BIC" appear in one record in "Table Original" - the result will only need to be placed in one of the new tables (really doesn't matter which one). For example, Record #4 includes the BIC "ABC" in field "BIC1" and the BIC "DEF" in the field "BIC4". Therefore, a new table would be created (either ABC or DEF) to capture this information.

View 4 Replies View Related

Queries :: Find Duplicate Records In Table With Two Fields

Aug 29, 2013

I want query to find duplicate records, i have two field in one table

Cusip and category

cusip and category are many or duplicates

but in one cusip category should be the same if not then provide the cusip which has different category used

like this
CusipCategory
123R
456P
123R
456P
678Q
678Q
123A

result should be

CusipCategory
123R
123R
123A

View 6 Replies View Related

Queries :: Update Some Data From Another Table - Joining Fields?

May 8, 2013

All; using 2010. I have a table that I need to update some data from another table. I want to use the SSN but one of the SSN fields in the table has letters at the end of it and doesnt return any records. How can I join fields?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved