I need to run a query that would pull information from a field that has 2 types of data .
Field is address and has 123 avenue as data and bb@yahoo.com.
I need to
If you have a street address and then an email address in the same field, and want to split them, then use this.
We'll call your original field Addy, and the new fields Street & Email.
SELECT Left(Addy, InStrRev(Addy, " ", InStr(Addy, "@")) - 1) AS Street, mid(Addy, InStrRev(Addy, " ", InStr(Addy, "@")) + 1) AS Email.
What this does is look for the @, then go backwards and look for the first space. The first function takes every left of that space and calls it Street, while the second function takes everything to the right.
The function is really 3 functions nested together. To really understand what it's doing, I'll dissect it.
I = InStr(Addy, "@")
J = InStrRev(Addy, " ", I)
Street = Left(Addy,J-1)