Works With SQL Not With Access

S

scorpion53061

This sql statement against an access database is not working in vb.net but
works in query analyzer when I sample it against a SQL table.
Maybe you guys know what I am doing wrong........

sql3 = "SELECT from CUSTOMERS WHERE CustShipTo = (select max(CustShipTo)
from customers where CustNumber = " & TextBox1.Text & " ) Order BY custid"
 
J

Joe Fallon

SELECT * from dbo_CUSTOMERS WHERE PostalCode = (select max(PostalCode)
from dbo_customers where CustomerID = "ALFKI" ) Order BY CustomerID

I added the * and changed some field names to work with the NWind Customers
table.
Now it seems fine.
 

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

Top