I have the following code which is causing an error code:-420 SQLERRMD = DECFLOAT


SELECT
S.BACKUP as "Company Name",
S.GROUP as "Company Address",
S.NOTES as "DSE",
S.CLIENT_ID_2 as "Longitude Degrees",
S.CLIENT_ID_3 as "Latitude Degrees",
CAST((S.CLIENT_ID_2*(3.141593/180)) AS FLOAT) as "Longitude Radians",
CAST((S.CLIENT_ID_3*(3.141593/180)) AS FLOAT) as "Latitude Radians",
(0.000785) as "r",
CAST(((S.CLIENT_ID_3*(3.141593/180)) - 0.000785)AS FLOAT) as "Min Latitude",
CAST(((S.CLIENT_ID_3*(3.141593/180)) + 0.000785) AS FLOAT) as "Max Latitude",
ASIN(SIN((CAST(S.CLIENT_ID_3 AS FLOAT))*(3.141593/180))/COS(0.000785)) as "LatT",
CAST(ASIN(SIN(0.000785)/COS((CAST(S.CLIENT_ID_3 AS FLOAT))*(3.141593/180))/COS(0.000785)) AS FLOAT) as "Delta Long",
(S.CLIENT_ID_2*(3.141593/180)) - (ASIN(SIN(0.000785)/COS((CAST(S.CLIENT_ID_3 AS FLOAT))*(3.141593/180))/COS(0.000785))) as "Min Long",
(S.CLIENT_ID_2*(3.141593/180)) + (ASIN(SIN(0.000785)/COS((CAST(S.CLIENT_ID_3 AS FLOAT))*(3.141593/180))/COS(0.000785))) as "Max Long",
ES."NUMBER OF POINTS"

FROM
BRDB_EXTRA.SUPPLEMENTAL S

LEFT JOIN
(SELECT
S.BACKUP,
COUNT(S.BACKUP) AS "NUMBER OF POINTS"
FROM BRDB_EXTRA.SUPPLEMENTAL S
WHERE
(S.CLIENT_ID_3*(3.141593/180))>=((S.CLIENT_ID_3*(3.141593/180)))
AND
(S.CLIENT_ID_3*(3.141593/180))<= ((S.CLIENT_ID_3*(3.141593/180)) + 0.003767)
AND
((S.CLIENT_ID_2)*(3.141593/180))>=((S.CLIENT_ID_2*(3.141593/180)) - (ASIN(SIN(0.003767)/COS((CAST(S.CLIENT_ID_3 AS FLOAT))*(3.141593/180))/COS(0.003767))))
AND
(S.CLIENT_ID_2*(3.141593/180))<= (S.CLIENT_ID_2*(3.141593/180)) + (ASIN(SIN(0.003767)/COS((CAST(S.CLIENT_ID_3 AS FLOAT))*(3.141593/180))/COS(0.003767)))


GROUP BY
S.BACKUP) AS ES
ON ES.BACKUP = S.BACKUP


WHERE LIST = 'DSE_ZIP'



I believe the error is caused by the last two where statements in the sub select statement, because the code runs fine when those lines are taken out. I just don't know how to fix the error. Any ideas would be great!