Help witha a query

T

toufik

Hi,

I've in my DB ms-access 2002 a table EMPLOYEE that contains 2 fields
"COMPANY" and "NAME" let's see this example
COMPANY NAME
======= ======
company1 name1-1
company1 name1-2
company2 name2-1
company3 name3-1
company3 name3-2
company3 name3-3
company3 name3-4

I like to have a query that give me the first name for each company, like
this
COMPANY NAME
======= ======
company1 name1-1
company2 name2-1
company3 name3-1

I need this in a vb.net windows form, ADO.net and a databade ms-access 2002
Any suggestion please?
Thanks.
 
G

Guest

Use an Aggregate Query like:

SELECT Company, First([Name]) ASTheFirstName
FROM [YourTable]
GROUP BY Company

BTW, Name is not a good choice for Field names since most objects in Access
(and perhaps, VB.Net) have the Property "Name" also. It can get very
confusing later.
 

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