Question Locked

sql:find domainname

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to extract a domainname from an emailaddress by sql from an sql database (the name after the '@'). By example: hotmail.com The addressfield is textbased.

How can i achieve this?

2 replies

by tony hopkinson

Given it's X@Y.Z
Select Substr([emailaddress],Instr([emailaddress],'@'),DataLength([EmailAddress]) - Instr([emailaddress],'@'))
From Contacts

Note assumes emailaddress is a varchar, DataLength would return fieldwidth for char and sometimes for text.

This discussion is closed to new replies.