Reputation: 1
I'm implementing this query with asp.net
in VB
, the objective of that query is to sort out the email data other than @yahoo.com
and @gmail.com
, it shows an error :
Incorrect syntax near '@yahoo' and '@gmail".
"select * from print_venue where not (email_id like %" & "@yahoo.com" & "%) AND (email_id like %" & "@gmail.com" & "%)"
What's wrong with the above query ?
Upvotes: 0
Views: 75
Reputation: 204894
You forgot the quotes around the like
statement
"select * from print_venue
where not (email_id like '%" & "@yahoo.com" & "%')
AND (email_id like '%" & "@gmail.com" & "%')"
It has to be
email_id like '%@yahoo.com%'
and not
email_id like %@yahoo.com%
Upvotes: 4