|
Hi,
What would an SQL statement look like that is doing an insert into an
existing table with
numeric fields? The catch is the selected data is being summed before being
inserted.
My query looks something like this:
INSERT INTO @BPDSPFW SELECT
PRPRTY,PRPSUB,PRPDES,PRODYR,PRODMO,SUM(ENTINT)
FROM LIB990/GBPDSPF
GROUP BY
PRPRTY,PRPSUB,PRPDES,COANL,VNAME02,PRODYR,Prodmo
The message I get back (Conversion error on assignment to column ENTINT.)
indicates that the Summed field is not correct for the target. In response to
the message I
modified the query using the decimal statement:
INSERT INTO @BPDSPFW SELECT
PRPRTY,PRPSUB,PRPDES,PRODYR,PRODMO,decimal(SUM(ENTINT),9,8)
FROM LIB990/GBPDSPF
GROUP BY
PRPRTY,PRPSUB,PRPDES,COANL,VNAME02,PRODYR,Prodmo
This yielded the same error.
Any thoughts?
Note: The target field ENTINT has a total length of 9 with 8 to the right of
the decimal.
Thanks,
Vance
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.