Select

shlvy

Regular
Joined
Oct 27, 2003
Hi
I have the next code:
cmdSelect = New SqlCommand( "Select au_id, au_lname, phone From Authors Order by au_lname", conPubs ).
I want to select and view a specific au_lname, let's say 'Green'.
What do i have to write? I tried the next sentence:
cmdSelect = New SqlCommand( "Select au_id, au_lname, phone From Authors Order by au_lname WHERE au_lname ="'Green', conPubs )
There is an error:')' expected.
Someone can help me?
Thank's.
 

Syko10-96

Newcomer
Joined
Nov 25, 2003
Location
Fredericksburg, VA
I can see 2 things wrong here...

Your WHERE clause has to be before your ORDER BY clause. Also, 'Green' needs to be inside the quotes with the rest of your statement...

i.e. "Select au_id, au_lname, phone From Authors WHERE au_lname = 'Green' Order by au_lname"

HTH
 
Top Bottom