Skip to content

Instantly share code, notes, and snippets.

@wneessen
Created January 11, 2011 14:48
Show Gist options
  • Save wneessen/774496 to your computer and use it in GitHub Desktop.
Save wneessen/774496 to your computer and use it in GitHub Desktop.
CASE COALESCE(HistoryGeneric.handle,0)
WHEN 0 THEN
CASE substring(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE
(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
Documents.Destination,' ',''),')',''),'(',''),
'-',''),'/',''),'.',''),'*',''),',',''),';',''),
'\',''),'-',''),1,1)
WHEN '1' THEN substring(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE( REPLACE(REPLACE(
REPLACE(Documents.Destination,' ',''),')',
''),'(',''),'-',''),'/',''),'.',''),'*',''),
',',''),';',''),'\',''),'-',''), 2, len(
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE( REPLACE(REPLACE(
REPLACE(Documents.Destination,' ',''),')',
''),'(',''),'-',''),'/',''),'.',''),'*','')
,',',''),';',''),'\',''),'-','')) )
ELSE REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(
REPLACE(REPLACE(REPLACE(Documents.Destination,' ',''),'-',''),')',
''),'(',''),'/',''),'.',''),'*',''),',',''),';',''),'\',''),'-','')
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment