Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: GroupBy Range?


Message #1 by "Craig Flannigan" <ckf@k...> on Tue, 16 Jul 2002 14:02:23 +0100
Thanks for your reply Dennis.

I already do this for some of the pages that need this facility. I just
wondered if I was doing it the wrong way, as in if I could achieve the same
output but by doing it all in SQL Code.

Cheers,

Craig.

-----Original Message-----
From: d.van.herk@w... [mailto:d.van.herk@w...]
Sent: 16 July 2002 13:56
To: ASP Databases
Subject: [asp_databases] Re: GroupBy Range?


Use a recordset. I call is rsResult

Do While Not rsResult.EOF
   case select rsResult("field")
        case 0 < 6: Group1 = Group1 + 1
        case 6 < 13: Group2 = Group2 + 1
   end case
   rsResult.MoveNext
Loop

Dennis

> Hi,
>
> Does anyone know if you can group results from a query by a range?
>
> I've a load of results which I really need counting into groups.
>
> Results 0-5 - Group 1
> Results 6-12 - Group 2
>
> etc...
>
> I know how to do GroupBy's but have never done this on results where there
> could be a range.
>
>
> I hope this isn't confusing!
>
>
> Regards
> Craig.
>
>
>
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet
> delivered through the MessageLabs Virus Scanning Service on behalf of
> Kingfield Heath Ltd. For further information visit
> http://www.star.net.uk/stats.asp
>
>
>





_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service on behalf of
Kingfield Heath Ltd. For further information visit
http://www.star.net.uk/stats.asp


_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service on behalf of Kingfield Heath Ltd. For further information visit
http://www.star.net.uk/stats.asp
Message #2 by "Craig Flannigan" <ckf@k...> on Tue, 16 Jul 2002 13:40:36 +0100
Hi,

Does anyone know if you can group results from a query by a range?

I've a load of results which I really need counting into groups.

Results 0-5 - Group 1
Results 6-12 - Group 2

etc...

I know how to do GroupBy's but have never done this on results where there
could be a range.


I hope this isn't confusing!


Regards
Craig.



_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service on behalf of Kingfield Heath Ltd. For further information visit
http://www.star.net.uk/stats.asp
Message #3 by d.van.herk@w... on Tue, 16 Jul 2002 14:55:43 +0200
Use a recordset. I call is rsResult

Do While Not rsResult.EOF
   case select rsResult("field")
        case 0 < 6: Group1 = Group1 + 1
        case 6 < 13: Group2 = Group2 + 1
   end case
   rsResult.MoveNext
Loop

Dennis

> Hi,
> 
> Does anyone know if you can group results from a query by a range?
> 
> I've a load of results which I really need counting into groups.
> 
> Results 0-5 - Group 1
> Results 6-12 - Group 2
> 
> etc...
> 
> I know how to do GroupBy's but have never done this on results where there
> could be a range.
> 
> 
> I hope this isn't confusing!
> 
> 
> Regards
> Craig.
> 
> 
> 
> _____________________________________________________________________
> This message has been checked for all known viruses by Star Internet
> delivered through the MessageLabs Virus Scanning Service on behalf of
> Kingfield Heath Ltd. For further information visit
> http://www.star.net.uk/stats.asp
> 
> 
> 




  Return to Index