fix for CASE expression in query with offset in ms sql
test added
Merge pull request #711 from lars-fomin/mssql

fix for CASE expression in query with offset in ms sql