Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-09-2009, 10:54 PM
NSTurk725 NSTurk725 is offline
Registered User
 
Join Date: 13 Mar 2009
Location: Malta
MS Office Version:Excel 2003
Posts: 42
NSTurk725 is becoming part of the community
Problems Populating Null Table-Field Values With an Update or Append Query

Please Register to Remove these Ads

Hi, I am trying to use an update query or append query or whatver works to populate some values into an existing table without just copy-pasting things in manually. Here is what I have...

I have a table called Unique with 10 fields; "A, B, C, D, E, F, G, H, I, J" . A-E already have data in them and the remaining fields have Null values. I would like to use a query or whatever may work to fill in the data to them without having to add additional rows. I have tried using an update query and a append query, but each just add additional rows while leaving the previous field values blank.

I have attached the DB to give a live example of what I am talking about.

I feel like there is a simple solution I am overlooking. I have been playing with this for a few hours. Thank you for any help anyone can provide. I appreciate it greatly.
Attached Files
File Type: zip Part_Data.zip (75.7 KB, 3 views)
Reply With Quote
  #2  
Old 06-10-2009, 02:19 AM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline
Valued Forum Contributor
 
Join Date: 11 Mar 2009
Location: Victoria, Canada
MS Office Version:2003
Posts: 574
ConneXionLost is attaining expert status ConneXionLost is attaining expert status
Re: Problems Populating Null Table-Field Values With an Update or Append Query

Hi NSTurk725,

A couple things here:

1. None of your tables have a primary key;

2. To merge the data onto the same rows, you'll need to identify one field in each of your source tables (ASP & RSP) that share common data. You'll then need to join those two fields. For example this would be an update query with the part numbers joined:

Code:
UPDATE RSP_Unique INNER JOIN [Unique] ON RSP_Unique.[RSP CUST PRT NUM] = Unique.CUSTM_PARTNU SET [Unique].RSPMDLCDE = [RSP_Unique].[RSPMDLCDE], [Unique].RSPASSYDESC = [RSP_Unique].[RSPASSYDESC], [Unique].[RSP CUST PRT NUM] = [RSP_Unique].[RSP CUST PRT NUM], [Unique].QTY_2009_SHU = [RSP_Unique].[QTY_2009_SHU], [Unique].AMT_2009_SHU = [RSP_Unique].[AMT_2009_SHU];
This query will fill in 17 rows with data, if that is what you're looking to do.

Cheers,
__________________
Docendo discimus.
Reply With Quote
  #3  
Old 06-10-2009, 01:26 PM
NSTurk725 NSTurk725 is offline
Registered User
 
Join Date: 13 Mar 2009
Location: Malta
MS Office Version:Excel 2003
Posts: 42
NSTurk725 is becoming part of the community
Re: Problems Populating Null Table-Field Values With an Update or Append Query

It still gave me additional rows. Here is sort of a visual of what Im loking for. It was sort of confusing when I first explained it. I apologize if for some reason I didnt follow your instructions carefuly, but I assigned a primary key and used your syntax.

WHAT I HAVE NOW:
H1 H2 H3 H4 H5 H6 H7 H8 H9 H10
XX XX XX XX XX - - - - - - - --
XX XX XX XX XX - - - - - - -- -
XX XX XX XX XX - - - - -- - - -
- - - - - - - - -- XX XX XX XX XX
- - - - - - - - -- XX XX XX XX XX
- - - - - - - - -- XX XX XX XX XX

WHAT I WANT:
H1 H2 H3 H4 H5 H6 H7 H8 H9 H10
XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX XX
XX XX XX XX XX XX XX XX XX XX XX
Reply With Quote
  #4  
Old 06-11-2009, 02:47 AM
ConneXionLost's Avatar
ConneXionLost ConneXionLost is offline
Valued Forum Contributor
 
Join Date: 11 Mar 2009
Location: Victoria, Canada
MS Office Version:2003
Posts: 574
ConneXionLost is attaining expert status ConneXionLost is attaining expert status
Re: Problems Populating Null Table-Field Values With an Update or Append Query

Hi NSTurk725,

The query I provided before does not add any rows to your "Unique" table, but it does update 17 rows (at the bottom) where the "CUSTM_PARTNU" and "RSP CUST PRT NUM" fields are the same between the Unique table and the RSP_Unique table. That's what I meant before when I was referring to "share common data". If there is another set of fields you intended to match between your tables, then please point them out since it isn't obvious to me what they might be.

Cheers,
__________________
Docendo discimus.
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump