Problem with sql statement in ASP.net

  • Thread starter Thread starter Teep
  • Start date Start date
T

Teep

I have a ddl list that displays Supplier Names, after a selection from
the list a datagrid is brought up from a sql table displaying only the
fields pertaining to that selection..

This is works fine, BUT now I have to add a sql statement that brings
up only the records that have have an "A" in the splr_id field.

Using SQL Enterprise Manager it pulled what I wanted, however it
doesn't work in my asp.net code.

Here is the SQL code:

"SELECT splr_id, splr_name, splr_addr, splr_city, splr_state FROM
tbl_of_suppliers WHERE splr_name='" & supname & "'"

This is what I want to add: AND LEFT(splr_sfx,1)='A'

Thanks in advance for the assistance.
 
where Substring(splr_sfx,1,1) = 'A'

may have to look up the Substring() in tSQL for exact butg that shoudl be
close.
 
Dang, that would have been easier then my method wouldnt it :}
Here I was thinking too much.
 
Thanks too Curt...I wrote done your solution as well, in my handy dandy
notebook for future reference! Thanks again! ;)

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Back
Top