473,654 Members | 3,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can i show and calculate total records count from tables.


Hi, i have some problem in showing data.

I have two tables
First table(containin g Hosting categories)
Second table(Containg catagories data lik
url,keyword,des cription.....et c)

I want to display catgories names from first table and then diffren
catagories
total records from second table, like this
ASP.NETHosting( 10)
Linux Hosting(20)
Windows hosting(13)
:
:
:
etc
How could i do this pls tell me
THANK
-
asa
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Jul 19 '05 #1
6 3814
Asad,

Psuedo-code version

open table 1
while not table1 eof
"asad" wrote:

Hi, i have some problem in showing data.

I have two tables
First table(containin g Hosting categories)
Second table(Containg catagories data like
url,keyword,des cription.....et c)

I want to display catgories names from first table and then diffrent
catagories
total records from second table, like this
ASP.NETHosting( 10)
Linux Hosting(20)
Windows hosting(13)
:
:
:
etc
How could i do this pls tell me
THANKS

--
asad
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jul 19 '05 #2
asad wrote:
Hi, i have some problem in showing data.

I have two tables
First table(containin g Hosting categories)
Second table(Containg catagories data like
url,keyword,des cription.....et c)

I want to display catgories names from first table and then diffrent
catagories
total records from second table, like this
ASP.NETHosting( 10)
Linux Hosting(20)
Windows hosting(13)


etc
How could i do this pls tell me


Without knowing your table structures (fieldnames, datatypes) I can't get
specific, but the answer will involve creating an inner join between the two
tables and the grouping by categories.

You will make it easier for us to help you if you provide a few sample rows
of data from your tables (in tabular format), and then show us the results
you wish to obtain from the sample data you provided.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #3
I'll try again...

open table 1
while not table 1 eof
subcount = 0
open subtable with id from table 1
while not subtable eof
subcount = subcount + 1
subtable.movene xt()
wend
close subtable
write table 1 field (subcount)
wend
close table 1
wend

there is actually a getrecords() method I think, but can't say ive ever used
it.

HTH, let me know if u need mroe code

Dan
"asad" wrote:

Hi, i have some problem in showing data.

I have two tables
First table(containin g Hosting categories)
Second table(Containg catagories data like
url,keyword,des cription.....et c)

I want to display catgories names from first table and then diffrent
catagories
total records from second table, like this
ASP.NETHosting( 10)
Linux Hosting(20)
Windows hosting(13)
:
:
:
etc
How could i do this pls tell me
THANKS

--
asad
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jul 19 '05 #4
Stop ... please. A recordset loop to do an aggregation? Have you never
heard of a GROUP BY query?

Bob Barrows

Dan Nash wrote:
I'll try again...

open table 1
while not table 1 eof
subcount = 0
open subtable with id from table 1
while not subtable eof
subcount = subcount + 1
subtable.movene xt()
wend
close subtable
write table 1 field (subcount)
wend
close table 1
wend

there is actually a getrecords() method I think, but can't say ive
ever used it.

HTH, let me know if u need mroe code

Dan
"asad" wrote:

Hi, i have some problem in showing data.

I have two tables
First table(containin g Hosting categories)
Second table(Containg catagories data like
url,keyword,des cription.....et c)

I want to display catgories names from first table and then diffrent
catagories
total records from second table, like this
ASP.NETHosting( 10)
Linux Hosting(20)
Windows hosting(13)


etc
How could i do this pls tell me
THANKS

--
asad
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #5
Bob,

Cant say I have.. perhaps you'd be kind enough to enlighten me?
"Bob Barrows [MVP]" wrote:
Stop ... please. A recordset loop to do an aggregation? Have you never
heard of a GROUP BY query?

Bob Barrows

Dan Nash wrote:
I'll try again...

open table 1
while not table 1 eof
subcount = 0
open subtable with id from table 1
while not subtable eof
subcount = subcount + 1
subtable.movene xt()
wend
close subtable
write table 1 field (subcount)
wend
close table 1
wend

there is actually a getrecords() method I think, but can't say ive
ever used it.

HTH, let me know if u need mroe code

Dan
"asad" wrote:

Hi, i have some problem in showing data.

I have two tables
First table(containin g Hosting categories)
Second table(Containg catagories data like
url,keyword,des cription.....et c)

I want to display catgories names from first table and then diffrent
catagories
total records from second table, like this
ASP.NETHosting( 10)
Linux Hosting(20)
Windows hosting(13)

etc
How could i do this pls tell me
THANKS

--
asad
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #6
See this for examples of GROUP BY

http://www.w3schools.com/sql/sql_groupby.asp

Drew

"Dan Nash" <da*@musoswire. co.uk> wrote in message
news:4D******** *************** ***********@mic rosoft.com...
Bob,

Cant say I have.. perhaps you'd be kind enough to enlighten me?
"Bob Barrows [MVP]" wrote:
Stop ... please. A recordset loop to do an aggregation? Have you never
heard of a GROUP BY query?

Bob Barrows

Dan Nash wrote:
I'll try again...

open table 1
while not table 1 eof
subcount = 0
open subtable with id from table 1
while not subtable eof
subcount = subcount + 1
subtable.movene xt()
wend
close subtable
write table 1 field (subcount)
wend
close table 1
wend

there is actually a getrecords() method I think, but can't say ive
ever used it.

HTH, let me know if u need mroe code

Dan
"asad" wrote:

>
> Hi, i have some problem in showing data.
>
> I have two tables
> First table(containin g Hosting categories)
> Second table(Containg catagories data like
> url,keyword,des cription.....et c)
>
> I want to display catgories names from first table and then diffrent
> catagories
> total records from second table, like this
> ASP.NETHosting( 10)
> Linux Hosting(20)
> Windows hosting(13)
>>
>>
>>
> etc
>
>
> How could i do this pls tell me
> THANKS
>
>
>
> --
> asad


------------------------------------------------------------------------
> Posted via http://www.codecomments.com


------------------------------------------------------------------------

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1363
by: Richard Holliingsworth | last post by:
Hello: I'm building a report to display statistics on the entire database. I have successfully built a report that groups the entire db on one field and gives me a count of db records for the categories in that field and a total record count for the db. Now, I need to add another "total database" grouping to get another set of record counts. I DO NOT want to nest this group, It MUST consider ALL database records.
2
6962
by: DC Gringo | last post by:
I have a datagrid control that has paging set up and working. What I would like is a total record count (not just per page) in the header or near the header of the datagrid. Here's my code: <asp:DataGrid AllowCustomPaging="false" AllowPaging="true" AllowSorting="true"
5
4004
by: js | last post by:
Can anyone help with the following Transact SQL question? Thanks. I need a store procedure to return the the result recordset which will be execute from a web page. The database has tables, A and B. For each A record, there are many related B records. In the B table there is a timestamp field which tracks the change of A record. For example, A1 has B like the followings: ID TimeStamp Chg Code Descption == ========= ======= ...
9
3057
by: Ericka | last post by:
I used the following query to count the number of records from each table. Select "Employee_Table" as Table_Name, Count(*) As Record_Total From Employer_table UNION ALL
4
1815
by: J | last post by:
I am editing a pre-existing view. This view is already bringing data from 40+ tables so I am to modify it without screwing with anything else that is already in there. I need to (left) join it with a new table that lists deposits and the dates they are due. What I need is to print, for each record in the view, the due date for the next deposit due and the total of all payments that they will have made by the next due date.
4
2743
by: Sector 7G | last post by:
I'm working with a SQL query for a Human Resources database. Its intended purpose is to find all the paycheck records with a check date (prckhist.chkdate ) more recent than eleven days past the employee's last raise (hrpersnl.p_paydate). It then totals the hours the employee worked from those records (prdehist.units), and if the total is within 40 hours of a threshold (hrpersnl.p_jmisc3) then the employee's name and information is returned, and...
2
2583
by: Otto | last post by:
Hi I'm migrating from Access til MySQL. Works fine so far - but one thing is nearly killing me: I got the count of total records in a variabel - (antalRecords) I got the count for the Field Q1 where the value value is = 'nej' Now I just need to calculate how many % of my records have the value 'nej' I access this worked very fine - but with MySQL ( and ASP) I just cant get it right!!! I go crazy ....
3
2199
by: Otto | last post by:
Hi I'm migrating from Access til MySQL. Works fine so far - but one thing is nearly killing me: I got the count of total records in a variabel - (antalRecords) I got the count for the Field Q1 where the value value is = 'nej' Now I just need to calculate how many % of my records have the value 'nej' I access this worked very fine - but with MySQL ( and ASP) I just cant get it right!!! I go crazy ....
5
24538
FishVal
by: FishVal | last post by:
IMHO, the following is not a how-to-do instruction to solve a particular problem but more a concept-proof stuff demonstrating possibilities of SQL. So, let us say the problem is to calculate business days count which is defined as count of days (optionally inclusive in the current implementation) excluding weekend days and holidays. Let us say periods to calculate are stored in table associated with contacts. keyPeriodID -...
0
8376
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8708
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8489
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8594
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2716
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.