When I try to trim records that have line breaks in the end sometimes I got an errors with specific codes. Where is mistake can be? 

```
SELECT f.Name FROM Firms f WHERE Replace(Replace(f.Code,CHAR(10),''),CHAR(13),'') = ".$firm_code."

```

Error1 :

> 
> The conversion of the varchar value '45308040080' overflowed an int
>  column.
> 
> 
> 

Error2:

> 
> Error converting data type varchar to numeric.
> 
> 
>