I have a query that returns the following data:
SELECT * FROM METAS
mes lj saldo meta
4 2 153:59 123:00:00
4 2 25:33 00:00:00
4 2 29:57 08:00
4 2 38:58 45:00:00
4 2 94:47 20:00
4 2 23:41 15:00:00
4 2 215:37 70:00:00
4 2 213:41 120:00:00
4 2 235:38 80:00:00
4 2 36:13 13:00:00
The more accurate it is done this way:
SELECT
mes,
lj,
SUM(saldo) as salto_total,
SUM(meta) as meta_total
FROM METAS
It returns me the following error:
Message 8117, Level 16, State 1, Line 1 Operand data type varchar is invalid for sum operator.
The reason is that my balance and meta fields are of the varchar format.
I'll be introduced to this hint
Plus it returns the following error:
Message 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '00: 00' to data type int.
How could you do this calculation?