allendks45
allendks45

Reputation: 341

Error when executing SQL Query on remote Database

I'm connected to a remote database through the university and have the following code for what seems to be a simple query. Can't figure out why I receive this error:

Msg 207, Level 16, State 1, Line 3
Invalid column name 'USA'.

If this is the same database we have previously downloaded and performed local queries the column it should work smoothly. My code through Sequel Management Studio is:

SELECT Customers.CompanyName, Customers.ContactName, Customers.Country
FROM Customers
WHERE (Customers.Country="Mexico") OR (Customers.Country="USA") OR (Customers.Country="Canada")

Upvotes: 0

Views: 187

Answers (1)

Ocaso Protal
Ocaso Protal

Reputation: 20237

You are using the wrong quotes in your query, use ' instead of ":

SELECT Customers.CompanyName, Customers.ContactName, Customers.Country
FROM Customers
WHERE (Customers.Country='Mexico') 
  OR (Customers.Country='USA') 
  OR (Customers.Country='Canada')

Upvotes: 1

Related Questions