You may select substrings only from columns of the types mentioned. Review all uses of square brackets in this statement, and make sure that each follows the name of a column that has one of these types. If that is the case, verify that you are using the database you intended, and double-check the definition of the table. Possibly one of the columns in the table has been altered to use a different type.