Problem with sql statement in ASP.net

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.
 
C

Curt_C [MVP]

where Substring(splr_sfx,1,1) = 'A'

may have to look up the Substring() in tSQL for exact butg that shoudl be
close.
 
C

Curt_C [MVP]

Dang, that would have been easier then my method wouldnt it :}
Here I was thinking too much.
 
T

TN Bella

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top