/ View Ticket
Login
Ticket Hash: a8b1e82b8f93415ed4601be04469bcfee91ff43d
Title: CAST failing for numeric
Status: Closed Type: Code_Defect
Severity: Severe Priority: Immediate
Subsystem: Unknown Resolution: Not_A_Bug
Last Modified: 2009-09-22 13:00:57
Version Found In: 3.6.18
Description:
While

SELECT CAST(COALESCE(SUM(amount), 0) AS INTEGER

returns as expected an integer, CAST doesn't work for NUMERIC:

SELECT CAST(COALESCE(SUM(amount), 0) AS NUMERIC always returns float


drh added on 2009-09-22 13:00:57:
FLOAT is NUMERIC. Casting to NUMERIC simply converts strings and blobs into numeric values. It does not change INTEGER into FLOAT.