I have a query that I am updating my temp table and need to use dates as a comparator. This mainly is due to foreign exchange rates. I need to insert the rate of the currency into a temp table based upon the date the document was generated. Below is my code:
UPDATE #Report -- Rate
SET Rate = (select cast(Rate as decimal(4,4)) as Rate from pb_exchangeratehistory where #report.docgamingdate = pb_exchangeratehistory.entrygamingdate)
I converted to decimal to make sure the rate would be like .7654 and not .765432199984298 as an example. The problem I am getting is the following error:
Arithmetic overflow error converting float to data type numeric.
The statement has been terminated.
Any help greatly appreciated!