I have a csv file which is exported from another system each day. The file contains various IP addresses with associated usage.
ex
Address Usage
10.15.22.198 1,200,000
10.15.22.198 1,100,000
10.22.15.194 950,000
10.52.18.187 911,000
10.26.12.194 901,000
10.57.83.187 850,000
I need to write a query to pull this data and put into usage bands and count how many are there.
ex.
Between 800,000 and 900,000 1
Between 900,000 and 1,000,000 3
>1,000,000 2
Software/Hardware used:
ASKED:
June 2, 2009 6:18 PM
UPDATED:
June 25, 2009 4:23 PM
The only reason for this type of data manipulation I can think of is to monitor bandwidth, of traffic recieved by an ip. (We have done this to load balance pc’s on subnets. Too many with a high usage rate in a subnet slows down the others.)
If I’m right then you are trying to rate the traffic to an ip. So each ip’s usage is evaluated and put into a usage class. Try something like this
table cell 1 = usage figure
table cell 2 = IP address
sort highest to lowest on column 1
Then it is just a case of checking if the usage value falls into a defined group, and copying the IP address into that group. You could copy the usage figure as well, just for continuity.
Hope this helps.
Dave
SELECT IIf([usage]>=850000 And [usage]<900000,’Between 850,000 and 900,000′,IIf([usage]>=900000 And [usage]<1000000,’Between 900,000 and 1,000,000′,’>1,000,000′)) AS txt, count(*) AS Qty
FROM YourTable
GROUP BY IIf([usage]>=850000 And [usage]<900000,’Between 850,000 and 900,000′,IIf([usage]>=900000 And [usage]<1000000,’Between 900,000 and 1,000,000′,’>1,000,000′)) ;