If you're using SQL server, you can do this:
SELECT emailaddress FROM E1_EmailAdr WHERE right(emailaddress,7)='aol.com'
if you're using Oracle,you can use substr function:
SELECT emailaddress FROM E1_EmailAdr WHERE
substr(emailaddress,len(emailaddress-7),7)='aol.com'
Or you can also do this:
SELECT emailaddress FROM E1_EmailAdr WHERE emailaddress like '%aol.com'
HTH,
Rizal
At 08:25 AM 10/2/2003, you wrote:
>I'm sure there's an easy way to do this, I'm just can't see it.
>I have a db with email addresses, I only want to retrieve those with
>"AOL.com" domains.
>I've tried the function #right(emailaddress, 7)# in a query statement in the
>WHERE clause, and using the VARIABLE.emailext without success.
>
>Here's the code:
>++++++++++++++++++
>
><!--- Used to check if the subscriber has an AOL email address
><cfset VARIABLES.emailext = Right(emailaddress, 7)>--->
><!--- End AOL Check --->
>
><!--- Query for the AOL addresses --->
><cfquery name="qAOLMessages" datasource="#REQUEST.dsn1#">
>SELECT emailaddress
>FROM E1_EmailAdr
>WHERE emailaddress IN ('AOL.com')
></cfquery>
>
><cfoutput>AOL Records = #qAOLMessages.recordcount#</cfoutput>
>
>++++++++++++++++++
>Thanks, Mark
>
>
>----------
>[
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

