Hey all,
There's a problem with this query:
Code:
SELECT p.an INTO GeneralWithout
FROM (SELECT Left([name],IIf(InStrRev([name]," ")>1, InStrRev([name]," ")-1,Len([name]))) AS an FROM Forgotten) AS p;
Basically I am trying to extract away a middle initial (or middle name) if it exists. It correctly extracts away middle initial in this scenerio:
Dougal Anthony John
outputing this:
Dougal Anthony
However, if the name has no middle initial:
Alvarado Michael
then it outputs this incorrectly:
Alvarado
whereas I wanted it to remain as is since no middle initial existed:
Alvarado Michael
Thanks for response