shlvy Posted August 31, 2004 Posted August 31, 2004 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. Quote
Syko10-96 Posted August 31, 2004 Posted August 31, 2004 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.