lundi 12 juin 2017

SQL Long Decimal Value Comparison

So I have two identical values that are results of sum functions with the exact same length (no rounding is being done). (Update, data type is float)

Value_1 = 29.9539194336501 Value_2 = 29.9539194336501

The issue I'm having is when I do an IF statement for Value_1 = Value_2, it comes up as FALSE.

Value_1:

SELECT SUM([INVN_DOL])/SUM([AVG_DLY_SLS_LST_35_DYS]) end as DSO
FROM TABLE A

Value_2:

SELECT SUM ([Total_Inventory_Val]) / SUM ([Daily_Independent_Demand])
FROM TABLE B

Any idea why they may not be exactly equal and what I can do to get a TRUE value since they do match?

Thanks in advance

Aucun commentaire:

Enregistrer un commentaire