I need to extract a portion of text from one field and put it in another field and I am having trouble with the syntex. I am doing this with an sql select statement in asp.net.
I can select the left most characters of the field (SELECT BatchNumber, LEFT(BatchNumber, 3) AS Expr1 FROM DonorHistory) or the right most characters of the field (SELECT BatchNumber, RIGHT(BatchNumber, 3) AS Expr1 FROM DonorHistory) but I cannot select characters from the middle of the field. I expected that to be able to use a statements such as "SELECT BatchNumber, mid(BatchNumber, 3, 2) AS Expr1 FROM DonorHistory" but this statement gives me an error. I also tried using middle in place of mid but that did not work either.
What am I doing wrong?
View Complete Post