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

Creating a count column

Status
Not open for further replies.

barrykellett

Programmer
Mar 4, 2003
29
GB
I am making a simple guestbook using an access database and have two tables, one with the thread title and one with all the thread replies.
I use this SQL to create a table of thread titles:

SELECT thread.threadid, thread.Title, thread.threaddate, guestbook.username, guestbook.ID
FROM guestbook INNER JOIN thread ON guestbook.threadid = thread.threadid
WHERE (((guestbook.Original)<>True))
ORDER BY thread.threadid DESC;

I need to ammend this sql so that the table this SQL outputs creates a count column every time it runs. (This will be to Count all replies with the same thread id as the title thread key)... but I am wondering would it be easier to create a new column in the dataset in my code and somehow put the count in there?

Can anyone show me some examples?

Thanks.
BK
 
if you are passing the dataset to the presentation layer then why dont u count the number of rows that exist in the table in the dataset

ds.Tables("TableName").Rows.Count

Hope that helps,

Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top