strSQL = "SELECT cdlAction, " & _
"cdlSerial_Number, " & _
"cdlRemedyProcess " & _
"From tblCustodial " & _
"WHERE cdlRemedyProcess IS NULL AND LEN(cdlAction)=7 AND cdlAction<>'Dispose' AND LEFT(cdlAction,2) BETWEEN 5 AND 35 " & _
"ORDER BY cdlAction"
I keep getting a “Conversion failed when converting the nvarchar” at this sql string when I debug. I do not see what I am doing wrong here.
I think casting the left(cdlAction,2) to an int might do it. He cant compare a string to an int from its own. So cast(cdlAction AS INT) might work.