Hi,
I am getting errors while inserting records in one table from another.
These are the structures of two tables :
file51tm_new
RecordType Text
RecordNumber Number
WorkCOde Text
Date TExt
Tck_nbr Text
time text
transno text
Start_date Text
End_date TExt
Tk_serial Text
tck_price text
void_code text
mag_encode text
red_date text
red_time text
batch number
file51tm_new_1
RecordType Text
RecordNumber Number
WorkCOde Text
Date date/time
Tck_nbr number
time text
transno number
tck_type number
Start_date date/time
End_date date/time
Tk_serial text
tck_price number
void_code text
mag_encode text
red_date date/time
red_time text
batch number
And this is the query :
I am trying to insert records from file51tm_new into file51tm_new_1 where the batch field is max and in the process, I am converting date fields ( in text format ) into date format. I get the following error :
Microsoft Access can't append all records in th query
Microsoft Access set 8 fields to Null due to a type conversion failure, and it didn't add 0 records to the table due to key violations, 0 records due to lock violations, and 0 records due to validation rule violations.
There is no primary key defined on either of the two tables, and there are no validation rules for any of the fields in both the tables.
Anybody able to help me on this ?
Would appreciate any solutions.
Thanks in advance,
I am getting errors while inserting records in one table from another.
These are the structures of two tables :
file51tm_new
RecordType Text
RecordNumber Number
WorkCOde Text
Date TExt
Tck_nbr Text
time text
transno text
Start_date Text
End_date TExt
Tk_serial Text
tck_price text
void_code text
mag_encode text
red_date text
red_time text
batch number
file51tm_new_1
RecordType Text
RecordNumber Number
WorkCOde Text
Date date/time
Tck_nbr number
time text
transno number
tck_type number
Start_date date/time
End_date date/time
Tk_serial text
tck_price number
void_code text
mag_encode text
red_date date/time
red_time text
batch number
And this is the query :
Code:
INSERT INTO FILE51TM_New_1 ( RecordNumber, WorkCode, [Date], Tck_Nbr, [Time], TransNo, Tck_Type, Start_Date, End_Date, Tk_Serial, Tck_Price, Void_Code, Mag_EnCode, Record_Type, Batch )
SELECT FILE51TM_New.RecordNumber, FILE51TM_New.WorkCode, IIf([Date]<>"",[DATE],"") AS Expr1, FILE51TM_New.Tck_Nbr, FILE51TM_New.Time, Val([TransNo]) AS Expr4, FILE51TM_New.Tck_Type, IIf([START_DATE]<>"",(Mid([Start_Date],1,2) & "/" & Mid([Start_Date],3,2) & "/" & Mid([Start_Date],5,2)),"") AS Expr2, IIf([END_DATE]<>"",(Mid([End_Date],1,2) & "/" & Mid([End_Date],3,2) & "/" & Mid([End_Date],5,2)),"") AS Expr3, FILE51TM_New.Tk_Serial, FILE51TM_New.Tck_Price, FILE51TM_New.Void_Code, FILE51TM_New.Mag_EnCode, FILE51TM_New.RecordType, FILE51TM_New.Batch
FROM FILE51TM_New
WHERE (((FILE51TM_New.Batch)=DMax("[FILE51TM_New]![Batch]","FILE51TM_NEw")));
Microsoft Access can't append all records in th query
Microsoft Access set 8 fields to Null due to a type conversion failure, and it didn't add 0 records to the table due to key violations, 0 records due to lock violations, and 0 records due to validation rule violations.
There is no primary key defined on either of the two tables, and there are no validation rules for any of the fields in both the tables.
Anybody able to help me on this ?
Would appreciate any solutions.
Thanks in advance,
Comment