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

Help with Sql statement in VB.Net..

Status
Not open for further replies.

RocAFella2007

Technical User
Mar 21, 2007
45
GB
Hi, I was wondering if somebody could offer me some help please. I have two tables, the first table is working but in my second table I want to take specific information

You see in the original table I have rows and rows of data, and what I want to do is just add all information together, for example in my original table I might have this:

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

Everything is working and correct, in my new table I want the data to be displayed like.

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

(Items returned ever late, should always remain 'NO' which is the default value, however if the user has ever returned an item late then I want late to be displayed. The lateness of the item is taken from the Notes column)

So all the data can be summed up. How would I sum all the data? Thanks

So far in my select statement I have:

Dim adapter As New OleDbDataAdapter("Select Name, Itemstaken, NumberofItems, Notes from ItemsGivenOut", conn)

Any help please?
 
Use the Sum() in you select statement you can Google it to get examples.

To go where no programmer has gone before.
 
Since this is more a SQL question, you should try posting it in the ANSI SQL forum. I think you'll get a better response there. Here's a link:

forum220

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top