User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 427,213 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,136 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 542 | Replies: 5 | Solved
Reply
Join Date: Jan 2008
Posts: 3
Reputation: Stagemgrrob is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Stagemgrrob Stagemgrrob is offline Offline
Newbie Poster

Help Selecting E-mail Addresses

  #1  
Jan 30th, 2008
I am not a developer or especially knowledgeable in MS SQL, but I am the person responsible for creating special queries for my companies SQL Database. I have a query that is selecting customer names, addresses, product ordered and e-mail addresses. I am want to select only those customers with an e-mail addresses (i.e. JohnSmith@AnyTown.Com). My problem is that the people entering the data aren't consistent in how they record a refusal to give an e-mail address(i.e. "Nope", "N/A", "No", etc.). I know that ALL e-mail addresses have the format USER_NAME@DOMAIN_NAME. I would like the selection criteria to be something like: select when EmailAddress is like "*@*".


Thank you in advance
StageMgrRob
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Selecting E-mail Addresses

  #2  
Jan 30th, 2008
SELECT * FROM Customers where EmailAddress like '%" @ "%'"
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Selecting E-mail Addresses

  #3  
Jan 31st, 2008
Originally Posted by Jx_Man View Post
SELECT * FROM Customers where EmailAddress like '%" @ "%'"


Why do we need double quotes around @ ? ("@")
PS. I tried it and it gave me an error.
We can use SELECT * FROM customers where emailaddresses like '%@%';
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Selecting E-mail Addresses

  #4  
Jan 31st, 2008
ah, i'm sorry for this failure. thx for the recovery.
Last edited by Jx_Man : Jan 31st, 2008 at 10:06 am.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Join Date: Jan 2008
Posts: 3
Reputation: Stagemgrrob is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Stagemgrrob Stagemgrrob is offline Offline
Newbie Poster

Re: Selecting E-mail Addresses

  #5  
Jan 31st, 2008
Thank you all. That is what I was looking for.
Reply With Quote  
Join Date: Nov 2007
Location: � Jogja �
Posts: 2,585
Reputation: Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light Jx_Man is a glorious beacon of light 
Rep Power: 11
Solved Threads: 235
Jx_Man's Avatar
Jx_Man Jx_Man is offline Offline
Posting Maven

Re: Selecting E-mail Addresses

  #6  
Jan 31st, 2008
yeah, you're welcome and thx to nav33n to nice recovery.
don't forget to mark this solved.
All for the best.
Never tried = Never Know
So, Please do something before post your thread.
* PM Asking will be ignored *
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS SQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 11:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC