Access IIF to SQL Statement convert

Dec 16 2020 9:52 AM
I'm trying and failing miserably to convert an Access Expression to SQL query
 
The MS Access Expression strips the following field data formats to extract the middle text between the 2 hyphens
 
2C00P02-CRIW-93201 (Extracted value: CRIW)
 
Any help appreciated
  1. Left(Mid([LINE_NUM],IIf(Len(Left([LINE_NUM],InStr([LINE_NUM],"-")))=0,1,Len(Left([LINE_NUM],InStr([LINE_NUM],"-")))+1)),InStr(Mid([LINE_NUM],IIf(Len(Left([LINE_NUM],InStr([LINE_NUM],"-")))=0,1,Len(Left([LINE_NUM],InStr([LINE_NUM],"-")))+1)),"-")-1)

Answers (1)