UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Append query - anomaly    
 
   
likajoho
post Dec 13 2005, 04:42 PM
Post #1

UtterAccess Guru
Posts: 956
From: Oklahoma



I have an append query that has been working fine, up until now.

A few weeks ago I added another field to it. Now that field is picking up the information from a different field. I can't figure out how or why.

I've checked the table I am using as the source. The information is correct there. I've checked the append query, and it looks fine, until you run it or view it in datasheet view. The interesting thing is that it is picking up the information from another field that is a look-up field in the destination table.

The source table is "ImportedList". The destination table is "Addresses". The field messing up is "FTType".

"AddType" is also in the query, but it is a number field looking up to the AddTypes table. Whereas the FTType field is a text field.

The information is the same for every recording being appended. It should be "Home" in the FTType field. The information is "8" (which is "List" in the AddTypes table). "List" is what is actually going to the FTType field.

I'm truly stumped on this. I've looked at the SQL view for the query and could find nothing amiss.

FYI, FTType is a translation of the AddType field which reduces the number of Types to 3 types. But it was entered by hand, so that shouldn't matter.

Any ideas?

Linda
Go to the top of the page
 
+
dannyseager
post Dec 13 2005, 04:44 PM
Post #2

UtterAccess VIP
Posts: 13,031
From: Leicester, UK



please post the sql
Go to the top of the page
 
+
likajoho
post Dec 13 2005, 06:08 PM
Post #3

UtterAccess Guru
Posts: 956
From: Oklahoma



INSERT INTO Addresses ( ID, AddType, FTType, IndDef, Add1, Add2, City, ST, Zip, County, AddNote, CongDist, Precinct, SD, HD, TempAddSrcID, ImpCode )
SELECT DISTINCTROW ImportedList.ID, ImportedList.AddType, Addresses.FTType, Addresses.IndDef, ImportedList.Add1, ImportedList.Add2, ImportedList.City, ImportedList.ST, ImportedList.Zip, ImportedList.County, ImportedList.AddNote, ImportedList.CongDist, ImportedList.Precinct, ImportedList.SD, ImportedList.HD, ImportedList.SrcID, ImportedList.ImpCode
FROM Addresses RIGHT JOIN ImportedList ON Addresses.ID = ImportedList.ID
WHERE (((ImportedList.Add1) Is Not Null)) OR (((ImportedList.City) Is Not Null)) OR (((ImportedList.ST) Is Not Null)) OR (((ImportedList.Zip) Is Not Null)) OR (((ImportedList.County) Is Not Null)) OR (((ImportedList.CongDist) Is Not Null)) OR (((ImportedList.Precinct) Is Not Null)) OR (((ImportedList.SD) Is Not Null)) OR (((ImportedList.HD) Is Not Null))
ORDER BY ImportedList.ID;

Thanks, Danny
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th May 2013 - 04:13 AM