changes to formatField() method to parse field names and allow flexibility to use mysql functions