This is a real easy one I assure you!!!

  • Thread starter Thread starter J.Alladien
  • Start date Start date
J

J.Alladien

Hi All,

I have a list with e-mailadresses like:

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed) ectc

How do I formatt these fields so I can sort them on the last part (on the
msn.com,pep.com) so after sorting it should look like:

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)



Thanks in advance!!!
 
It's not about formatting the field, but rather parsing the domain from the
e-mail address. Assuming the e-mail field is named (e-mail address removed)
 
J.Alladien said:
Hi All,

I have a list with e-mailadresses like:

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed) ectc

How do I formatt these fields so I can sort them on the last part (on the
msn.com,pep.com) so after sorting it should look like:

(e-mail address removed)
(e-mail address removed)
(e-mail address removed)
(e-mail address removed)


Try this:

ORDER BY Mid((e-mail address removed)
 
You can't do it by formatting; use a query, using the Instr function to
identify the position of the @ character, and the Mid function to return the
substring to its right, e.g.

SELECT *
FROM YourTable
ORDER BY MID([EmailAddress],INSTR([EmailAddress],"@")+1);

or you can use the Right and InstrRev functions like so:

ORDER BY RIGHT([EmailAddress],INSTRREV([EmailAddress],"@")+1)

Ken Sheridan
Stafford, England
 
Thanks , works great

Please help me with another one , I tried it but it doensnt work,I am not so
skilled!

hardware ([email protected])
melvink ([email protected]
duyker ([email protected])

I would like to display this list as :

hardware
melvink
duyker

Thank in advance





BruceM said:
It's not about formatting the field, but rather parsing the domain from the
e-mail address. Assuming the e-mail field is named (e-mail address removed)
 
Back
Top