I want to make sure I am doing this the most efficient way. I am comparing in a query a nullable float amount to a nullable decimal amount. Right now I seem to have to do this in order for the compare to work correct.
AND LTRIM(RTRIM(ISNULL(CFS.Amount,0))) = LTRIM(RTRIM(CAST(ISNULL(CDC.Amount,0) AS decimal(18,2))))
The trimming seemed to be needed as well as latest I realized I needed an ISNULL check to 0 as well. Is there a better way to do this? No idea why I needed the trim but it seemed to need it or things were being missed. I have the values coming from two different sources one is using a float and one a decimal(18,2).