query for gettin a string starin with particular alphabet

sevenbellls

Member
Joined
Nov 14, 2005
Messages
5
Programming Experience
Beginner
CAN U PLZ FORWARD THE
"query for getting a name starting with paritcular alphabet in vb."
MY SAMPLE CODE IS GIVEN BELOW

Dim str As String = " select * from stock where product_name like '" & TextBox1.Text & "''" & % & "' "

thnks and rgds
sevenbellls
 
This is for Northwind. It will return all the Company Names beginning with "A"

"SELECT * FROM Customers WHERE substring(CompanyName,1,1) = 'A'"

(note: case of "A" doesn't make a difference)
 
Back
Top