trouble with merging info

XKIMBAL

New member
Local time
Today, 17:24
Joined
Jun 27, 2002
Messages
9
I have 1 table that has 1184 records with a number of fields including 1 field for the count purposely left blank (or Null). I have another table with 654 records that has a count in that field. I first want to populate the 1st table with the count information then populate the null's with 0's...

I just can't seem to do it. I get very strange results of a huge number of records and am gettign a little frustrated.
Please help ... Thanx
 
Hi XKIMBAL,

Are you trying to update a field table 1 where a similar record exists in table 2? What are the names of the fields? Can you give a bit more detail please?

Cheers,

~Pete
 
MORE DETAILS

I have a table that has the fields:

psk (serial number) disp (type of sale) count
1718 1 7
1718 10 1
1719 5 8
1719 10 2

Which is OK, but the recordcount is incorrect. I need to have a count of 1184 in records I only have 654. Reason being that text file I imported doesn't have any values of 0. For instance, for the psk 1718 I need to have 4 records (one for each type of sale.) But the file only came with 2. I have created another table with the correct number of records (psk and all 4 types of sales) and no value in the count field. It looks like:

psk disp count
1718 1
1718 5
1718 10
1718 15
1719 etc....

Now I wanted the original table to populate the count field where the first 2 fields match. Then put a 0 in the count fields that are null afterwards. Is this possible?

Thanx...
 
It's not necessary to post the same topic in three forums. It leads to confusion. Did the answer I gave in the Queries forum not work?
 
I think you can sort this out by creating two UPDATE queries.

As far as I understand it you have two table. One has all the serial numbers with all the different types of sales. I'll call this table "tblALLRECs". The other table is what comes from the text file. I'll call this "tblText".

The first query will update tblALLRECs to include the count information from tblText.

In the query add both tables. Link the fields PSK and DISP. Drag and drop the COUNT field into the query grid. In the "Update To" field insert [tblText].[Count]. (obviously you'll replace "tblText" with whatever your table is actually called).

If you run this it will populate your count field in tblAllRECs but you'll still have blanks. To populate these with zeros create another update query, this time just add tblAllRecs. In the update to field, add zero. In the criteria field add "Is Null".

I hope this all makes sense and I hope it works. If not, let me know.

In the meantime I'll go and consult with the fabled tea leaves of Ulugulu.

~Pete
 
See what I mean? How are your field names, Pete?:D
 
Weeeellllll, I've managed to get through the whole day without having to do any rekeying or renaming. In fact to be perfectly honest I've done bugger all work all day.

So I'm a happy bunny. Thanks for the suggestions for the renaming thing by the way. Have a good weekend!

~Pete
 

Users who are viewing this thread

Back
Top Bottom