How do i replace a null record with a string in Microsoft Acces

I have a very large table (table#1) with over 130,000 records.  i have another table that is empty with just many field names and all with empty records(table#2) which is really a template that cannot change its field name order.  I need to update some of the fields in the table2 template with records from fields in table#1.  Other fields i will need to populate with a specific string.

Help!

Thank you!  
ZedwayAsked:
Who is Participating?
 
Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:
Can you post a *specific* example please?

Nulls are often associated with Numeric fields.
So numeric fields cannot contain strings (text)

In a nutshell you can replace all nulls in a field with an update query similar to this:

UPDATE YourTable SET YourTable.YourNullField = "SomeString"
WHERE YourTable.YourNullField Is Null;

But again, we need a specific example to be sure...

JeffCoachman


0
 
OP_ZaharinConnect With a Mentor Commented:
1.  "I need to update some of the fields in the table2 template with records from fields in table#1"
- assuming relationship column between table1 and table2 is col1

UPDATE table2 a SET a.col2 = (SELECT b.col2 FROM table1 b WHERE b.col1 = a.col1)

Open in new window


2. "Other fields i will need to populate with a specific string."
- assuming you have run the update in #1 above and column in table2 left with only those records null and no relation/data exist in table1

UPDATE table2 a SET a.col2 = 'anystring' WHERE a.col2 IS null

Open in new window


0
 
GRayLCommented:
Are you saying you need to change the name of some of the fields in table2 based on names in table1?  If you start adding data to table2, it will not longer be empty - just a template.  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.