CRAFTERCMS-92

Incorrect syntax for SQL Server query fixed.