Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Summarising data based upon range values in another table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-02-25 : 10:57:39
Paul writes "I need to Summarise (count) the number of items (Table A) within age groups which are held in Table B.

The groups are for example 0-1 days; 2-5 days; 6-17 days; 18 days + ..... These values need to be flexible hence why I am storing each grouping as a row with ageFrom and ageTo columns.

Can I create a stored procedure (Cross tab ?) which will produce

1. a column for each row from Table B
2. rows with totals in each column based upon the age range

I am using SQL Server 7 (SP3) and NT(SP4) and want to execute the Stored Procedure from VB6(SP4) using ADO(MDAC 2.5).

Thanks"
   

- Advertisement -