Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Multiple where clause?

Author  Topic 

msugradus
Starting Member

40 Posts

Posted - 2007-06-11 : 16:26:11
where exigo_data_sync.orderdetail.itemcode in (B1001, B1001B, B1007, B1007B, B1008, B1008B, B1000, B1000B, B1006, B1006B, B1009, B1009B)

I keep getting a ADO error stating invalid column names...these are not column names they are the data that i want to use in the where clause. What am I doing wrong?

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-06-11 : 16:30:25
you need to put quotes around the values since they are string type.
where exigo_data_sync.orderdetail.itemcode in ('B1001', 'B1001B', 'B1007', 'B1007B', 'B1008', 'B1008B', 'B1000', 'B1000B', 'B1006', 'B1006B', 'B1009', 'B1009B'


Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-06-12 : 08:58:19
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -