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
 Transact-SQL (2000)
 Query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-29 : 11:30:12
vijaya writes "Hi

I doing a project on Contact Rate improvement....and for this i am colating some data....i need some help in this.

i am forwarding a query

Select Bhvr_Scr From ABC
where (L1Time >= '19 June 2004' and L1time < '20 June 2004')and (Bhvr_Scr >= '100' and Bhvr_Scr< '200').

i need to take the bhvr_scr for perticular date in such a way that i will get all break up at onego.

ex: 100-200
200-300
300-400 and so on"

gpl
Posting Yak Master

195 Posts

Posted - 2004-06-29 : 17:26:16
quote:
Originally posted by AskSQLTeam

vijaya writes "Hi

I doing a project on Contact Rate improvement....and for this i am colating some data....i need some help in this.

i am forwarding a query

Select Bhvr_Scr From ABC
where (L1Time >= '19 June 2004' and L1time < '20 June 2004')and (Bhvr_Scr >= '100' and Bhvr_Scr< '200').

i need to take the bhvr_scr for perticular date in such a way that i will get all break up at onego.

ex: 100-200
200-300
300-400 and so on"



Im not entirely sure what it is you want, but it would seem that you want some kind of grouping - so Ill give you the count of Bhvr_Scr that appears in each group -

Select
Convert(Int, Bhvr_Scr / 100) * 100, Count(*)
From ABC
where (L1Time >= '19 June 2004' and L1time < '20 June 2004')and (Bhvr_Scr >= '100' and Bhvr_Scr< '200').
Group by Convert(Int, Bhvr_Scr / 100) * 100
Order By 1

the little sum divides your Bhvr_Scr number by 100, drops off any decimal part and then multiplies it by 100 again to restore it to the original range number (ie just the hundreds)

is this what you were after, or have I missed the point entirely ?? it would help if you posted your table structure and some more sample data

Graham
Go to Top of Page
   

- Advertisement -