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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with select statement..

Status
Not open for further replies.

RocAFella2007

Technical User
Mar 21, 2007
45
GB
Hi, I need help with a Select statement please. I have tried using Sum and Count functions in this statement but its just not working. Basically in my table I have three columns, the first contains a name, the second contains items, the third contains a number (the number of items in column 2).

I need a Select statement which will sum up all of the information, for example currently the table looks like:

Items Borrowed - Number of Items Borrowed - Borrowed Date - Return Date - Notes - Returned On Time
User1
User2
User3
User2
User3
User2

I want to take some information from the table so my output would be like:

All Items Borrowed - Number of Items Borrowed - Items returned ever late.
User1
User2
User3

The tricky part is as I am using SQl with VB, the data in the second column is recorded as (item1, item2, item,3) Is there a way of joining all items together for User1, User2 etc?

Any help or suggestions please.
 
With the example data you've posted:
SELECT DISTINCT name

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top