That's a simple programming error. Let's say charindex('.',mycolumnName)-1 produces x where there is a '.' in the column; it will produce -1 where there is none. You want the substring to extract a string starting at 1 [correct ?] for the length of x [correct ?]. That works nicely when you have a '.' somewhere in the data. What happens when you have none ?
Select mycolumnName where charindex('.',mycolumnName) = 0