Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

datatable.select problem.

Status
Not open for further replies.

chebbi

Programmer
Feb 6, 2002
98
IN
Hi all

I have to run a sql query which looks like
select * from name where name like '[0-9]%'

This works fine in query analyser and returns me all names starting with numerical charater but if i put it in datatable.select as below i get the error

"The string pattern is invalid '[0-9]%'.

My code:

datatable.select( "Name like '[0-9]%'" ).

I also tried
datatable.select( "Name like '[0-9][%]'" ) to escape % but with same error message as result.

Can anyone let me know how to use brackets inside of select statement?

Thanks
Badrinath Chebbi

Badrinath Chebbi
 
How about using something like:
Code:
datatable.Select("SUBSTRING(Name,1,1) IN (0,1,2,3,4,5,6,7,8,9,0)")



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top