Re: Decimal fields's precision is too small to accept the numeric you attempted to add



This fails even as a SELECT query.

SELECT customer_type.name, invoice_h.prebook_id, item_types.name,


Sum([invoice_d]![price]*((100+[invoice_d]![discount])/100)*[invoice_d]![ship_qty]) AS Extended_Gross,


Sum([invoice_d]![price]*[invoice_d]![ship_qty]) AS
Extended_Net
FROM ((((invoice_d LEFT JOIN invoice_h ON invoice_d.invoice_id =
invoice_h.invoice_id) LEFT JOIN item ON invoice_d.item_id = item.item_id)
LEFT JOIN item_types ON item.item_type = item_types.type_id) LEFT JOIN
customer ON invoice_h.customer_id = customer.customer_id) LEFT JOIN
customer_type ON customer.customer_type_id = customer_type.customer_type_id
GROUP BY customer_type.name, invoice_h.prebook_id, item_types.name;

The isolated line is the problem child. Remove it, query fine.

I changed it to
CDbl(NZ(Sum(CDbl(NZ([invoice_d]![price],0))*((100+CDbl(NZ([invoice_d]![discount],0))/100))*CDbl(NZ([invoice_d]![ship_qty],0)))))

isolating every single piece and forcing it to a Double, as well as forcing the whole thing as a double, same answer.




Allen Browne wrote:
Switch your Make Table query to SQL View (View menu in query design), copy the SQL statement, and post it here.

.



Relevant Pages