For ex. if the your email is like Myemailaddress@gmail.com#mailto:Myemss@gmai l.com#
FirstOccurrence : InStr(1,[EmailAddress],"#") is 25
LastOccurrence : InStrRev(EmailAddress],"#") = length of the email address field
The required mail address is Mid([EmailAddress],1,[FirstOccurrence]-1)
The LastOccurrence is not required if there you need the string before the first # tag only.
The SQL looks like
Code:
SELECT tblCandidates.Candidate, InStr(1,[EmailAddress],"#") AS FirstOccurrence, InStrRev([EmailAddress],"#") AS LastOccurrence, Mid([EmailAddress],1,[FirstOccurrence]-1) AS ReqdMailAddress
FROM tblCandidates;
Hope this helps.