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.
Author |
Topic |
Mohamed Gani
Starting Member
2 Posts |
Posted - 2013-07-14 : 06:49:30
|
Hi,I m trying to executeSQL Query in Excel vba,Below is a querySELECT stu_id, stu_name, stu_classFROM stu_tableWHERE stu_name IN('JACK', 'WILLIAM') ANDstu_class IN ( 10,12)But it doesn't work.does it possible to usemultiple IN operator fordifferent column ?Thanks in advancegani |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-07-14 : 07:17:19
|
I dont know about Excel VBA but the query syntax looks fine for SQL Server. can you give more information on the error?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2013-07-14 : 15:23:08
|
Underscore character is a line-continuation character.Let Stu_name in the select clause be a complete column name. N 56°04'39.26"E 12°55'05.63" |
|
|
Mohamed Gani
Starting Member
2 Posts |
Posted - 2013-07-15 : 04:12:35
|
I removed the underscore( _ ) from column name but still error occured.Err Description : " Syntax Error "gani |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2013-07-15 : 04:52:49
|
i think what Peter mean was don't break the "stu_name" into 2 lines, keep the column name stu_name on the same line KH[spoiler]Time is always against us[/spoiler] |
|
|
|
|
|