Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

first parameter x of the decimal (x, y)

As I can determine the first parameter of the decimal data type, sometimes I had to put 10 and sometimes I put the value of 11, I did a lot of tests. There is some function that allows me to determine the value of the first parameter x of the decimal (x, y)

select PERIODO, SUM(CAST(DEBE AS decimal(10,2))) AS DEBE_MENSUAL,
            SUM(CAST(HABER AS decimal(10,2))) AS HABER_MENSUAL
FROM [dbo].[Octubre]
WHERE ISNUMERIC(DEBE)=1 AND ISNUMERIC(HABER) = 1
GROUP BY PERIODO


UNION ALL
select PERIODO, SUM(CAST(DEBE AS decimal(11,2))) AS DEBE_MENSUAL
            , SUM(CAST(HABER AS decimal(11,2))) AS HABER_MENSUAL
FROM [dbo].[Diciembre]
WHERE ISNUMERIC(DEBE)=1 AND ISNUMERIC(HABER) = 1
GROUP BY PERIODO
ASKER CERTIFIED SOLUTION
Avatar of Nakul Vachhrajani
Nakul Vachhrajani
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial