E
Elsie
Hi all,
I am trying to append a query to a table. Both the query and table have the
same number of fields. But I got a type conversion failure when I try to
append.
After some testing, found that inv_num and do_num are the ones causing the
problems. AFAIK, both do_num and inv_num are string type.
For do_num, I am trying to use Val(do_num). But this only works for those
deliver orders that are numeric... if alpha numeric do_num, this does not
work.
For inv_num, I tried Val(inv_num), Str(inv_num) and Mid(inv_num), but all
don't work....
INSERT INTO Sales_Report_YD ( goods, do_num, inv_num, item, description,
product_code, cust_num, cust_seq, county, country, name, cust_type,
qty_invoiced, price, cost, curr_code, inv_date, eff_date, sell_rate,
SalesAMT, CostAMT )
SELECT Sales_Report_M0410.goods, Val([do_num]) AS do,
Sales_Report_M0410.inv_num, Sales_Report_M0410.item,
Sales_Report_M0410.description, Sales_Report_M0410.product_code,
Sales_Report_M0410.cust_num, Sales_Report_M0410.cust_seq,
Sales_Report_M0410.county, Sales_Report_M0410.country,
Sales_Report_M0410.name, Sales_Report_M0410.cust_type,
Sales_Report_M0410.qty_invoiced, Sales_Report_M0410.price,
Sales_Report_M0410.cost, Sales_Report_M0410.curr_code,
Sales_Report_M0410.inv_date, Sales_Report_M0410.eff_date,
Sales_Report_M0410.sell_rate, Sales_Report_M0410.SalesAMT,
Sales_Report_M0410.CostAMT
FROM Sales_Report_M0410;
I am trying to append a query to a table. Both the query and table have the
same number of fields. But I got a type conversion failure when I try to
append.
After some testing, found that inv_num and do_num are the ones causing the
problems. AFAIK, both do_num and inv_num are string type.
For do_num, I am trying to use Val(do_num). But this only works for those
deliver orders that are numeric... if alpha numeric do_num, this does not
work.
For inv_num, I tried Val(inv_num), Str(inv_num) and Mid(inv_num), but all
don't work....
INSERT INTO Sales_Report_YD ( goods, do_num, inv_num, item, description,
product_code, cust_num, cust_seq, county, country, name, cust_type,
qty_invoiced, price, cost, curr_code, inv_date, eff_date, sell_rate,
SalesAMT, CostAMT )
SELECT Sales_Report_M0410.goods, Val([do_num]) AS do,
Sales_Report_M0410.inv_num, Sales_Report_M0410.item,
Sales_Report_M0410.description, Sales_Report_M0410.product_code,
Sales_Report_M0410.cust_num, Sales_Report_M0410.cust_seq,
Sales_Report_M0410.county, Sales_Report_M0410.country,
Sales_Report_M0410.name, Sales_Report_M0410.cust_type,
Sales_Report_M0410.qty_invoiced, Sales_Report_M0410.price,
Sales_Report_M0410.cost, Sales_Report_M0410.curr_code,
Sales_Report_M0410.inv_date, Sales_Report_M0410.eff_date,
Sales_Report_M0410.sell_rate, Sales_Report_M0410.SalesAMT,
Sales_Report_M0410.CostAMT
FROM Sales_Report_M0410;