You have an error in your SQL syntax near 'AND files.end_vers_major * 10000 + files.end_vers_minor * 100 + files.end_ve' at line 8