Update Query and Memo Fields

gregch

Registered User.
Local time
Today, 03:48
Joined
Sep 30, 2008
Messages
20
I receive a flat text file from another database application. From this text file, I import the data and run update queries to build 2 related tables (Inspection and Inspection detail). Everything works fine except one of the fields that is generated in the text file that I import is a memo field. There are times when this field is longer than 255 characters. Is there any way to prevent Access from truncating the memo field when the query runs?

Thanks in advance for the help!
 
Don't do anything at all to that field and it should come through just fine. If you need more specific help then stories do not help. Showing the SQL does.
 
I wish I could leave the field as is, but I need to create 2 related tables from the imported text file. Below is the SQL that I am working with. Is there any way to prevent Import Statement from being truncated when the query runs?

INSERT INTO Inspection ( ID, Inspection_Date, Serial_No, Permit_Number, Number_In_Shipment, Area_Status_Brucellosis, Area_Status_Tuberculosis, [Herd_Status_Aujeszky's (PRV)], Treated_For, Treated_Date, Product, [Statement/Comment], Date_of_Last_Herd_Test, Vet_ID, Herd_Status_Brucellosis, Herd_Status_TB, Brucellosis_Test_Date, Brucellosis_Test_Lab, Other_Tests_Date, Other_Tests_Lab, Other_Tests_Description, Certificate_Date, OA_Name, OA_Address, OA_City, OA_State, OA_Zip, Breeding, Feeding, Slaughter, Exhibition, R_Date, R_Name, R_Address, R_City, R_State, R_Zip, R_Premises_ID_NO, Cattle, Dairy, Swine, Horses, Sheep, Poultry, Other, Import_Statement, C_ID, C_Name, C_Address, C_City, C_State, C_Zip, C_Premises_ID_No, C_Phone, C_Phone2, O_ID, O_Name, O_Address, O_City, O_State, O_Zip, O_Premises_ID_No, O_Phone, O_Phone2, Origin_Address, Origin_City, Origin_State, Origin_zip, D_Name, D_Address, D_City, D_State, D_Zip, Goats )
SELECT DISTINCT tbl_temp_import.Field1 AS ID, tbl_temp_import.Field2 AS Inspection_Date, tbl_temp_import.Field3 AS Serial_No, tbl_temp_import.Field4 AS Permit_Number, tbl_temp_import.Field5 AS Number_in_Shipment, tbl_temp_import.Field6 AS Area_Status_Brucellosis, tbl_temp_import.Field7 AS Area_Status_Tuberculosis, tbl_temp_import.Field8 AS [Herd_Status_Aujeszky's (PRV)], tbl_temp_import.Field9 AS Treated_For, tbl_temp_import.Field10 AS Treated_Date, tbl_temp_import.Field11 AS Product, tbl_temp_import.Field12 AS [Statement/Comment], tbl_temp_import.Field13 AS Date_of_Last_Herd_Test, tbl_temp_import.Field14 AS Vet_ID, tbl_temp_import.Field15 AS Herd_Status_Brucellosis, tbl_temp_import.Field16 AS Herd_Status_TB, tbl_temp_import.Field17 AS Brucellosis_Test_Date, tbl_temp_import.Field18 AS Brucellosis_Test_Lab, tbl_temp_import.Field19 AS Other_Tests_Date, tbl_temp_import.Field20 AS Other_Tests_Lab, tbl_temp_import.Field21 AS Other_Tests_Description, tbl_temp_import.Field22 AS Certificate_Date, tbl_temp_import.Field23 AS OA_Name, tbl_temp_import.Field24 AS OA_Address, tbl_temp_import.Field25 AS OA_City, tbl_temp_import.Field26 AS OA_State, tbl_temp_import.Field27 AS OA_Zip, tbl_temp_import.Field28 AS Breeding, tbl_temp_import.Field29 AS Feeding, tbl_temp_import.Field30 AS Slaughter, tbl_temp_import.Field31 AS Exhibition, tbl_temp_import.Field32 AS R_Date, tbl_temp_import.Field33 AS R_Name, tbl_temp_import.Field34 AS R_Address, tbl_temp_import.Field35 AS R_City, tbl_temp_import.Field36 AS R_State, tbl_temp_import.Field37 AS R_Zip, tbl_temp_import.Field38 AS R_Premises_ID_NO, tbl_temp_import.Field39 AS Cattle, tbl_temp_import.Field40 AS Dairy, tbl_temp_import.Field41 AS Swine, tbl_temp_import.Field42 AS Horses, tbl_temp_import.Field43 AS Sheep, tbl_temp_import.Field44 AS Poultry, tbl_temp_import.Field45 AS Other, Qry_Inspection_updateA.Import_Statement, tbl_temp_import.Field47 AS C_ID, tbl_temp_import.Field48 AS C_Name, tbl_temp_import.Field49 AS C_Address, tbl_temp_import.Field50 AS C_City, tbl_temp_import.Field51 AS C_State, tbl_temp_import.Field52 AS C_Zip, tbl_temp_import.Field53 AS C_Premises_ID_No, tbl_temp_import.Field54 AS C_Phone, tbl_temp_import.Field55 AS C_Phone2, tbl_temp_import.Field56 AS O_ID, tbl_temp_import.Field57 AS O_Name, tbl_temp_import.Field58 AS O_Address, tbl_temp_import.Field59 AS O_City, tbl_temp_import.Field60 AS O_State, tbl_temp_import.Field61 AS O_Zip, tbl_temp_import.Field62 AS O_Premises_ID_No, tbl_temp_import.Field63 AS O_Phone, tbl_temp_import.Field64 AS O_Phone2, tbl_temp_import.Field85 AS Origin_address, tbl_temp_import.Field86 AS Origin_city, tbl_temp_import.field87 AS Origin_state, tbl_temp_import.field88 AS Origin_zip, tbl_temp_import.field89 AS D_Name, tbl_temp_import.field90 AS D_Address, tbl_temp_import.field91 AS D_City, tbl_temp_import.field92 AS D_State, tbl_temp_import.field93 AS D_zip, tbl_temp_import.field94 AS Goats
FROM tbl_temp_import INNER JOIN Qry_Inspection_updateA ON tbl_temp_import.Field3 = Qry_Inspection_updateA.Serial_No;

If there is a better way to break down the flat file to 2 related tables and keep the memo field from being truncated, please let me know.

Thanks!
 

Users who are viewing this thread

Back
Top Bottom