By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,359 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,359 IT Pros & Developers. It's quick & easy.

hi needed help in a query

P: 11
hi iam raam


select count(*) as [No of Callers] from
(select empcode,empname,count(*) as [No of Calls],convert(varchar(10),details.Logintime ,101) as Date
from details join employee on employee.empid = details.empcode
where employee.Permission <> '1' and details.Logintime between '06/10/2006' and '06/11/2006'
group by empcode,empname, convert(varchar(10),details.Logintime ,101))e



i have this query to get count of callers.But i want date wise count of callers from table name status details.
just like this

date No of callers
06/07/2006 45
06/07/2007 50


can any one help me
thanks
Jun 16 '08 #1
Share this Question
Share on Google+
3 Replies


P: 3
You should only have to group by date to get the results you want.
Jun 16 '08 #2

P: 11
You should only have to group by date to get the results you want.
ya i have done it.but no result as such a way.
Jun 16 '08 #3

P: 3
Expand|Select|Wrap|Line Numbers
  1. SELECT DETAILID, COUNT(*) "NUMBER OF CALLERS" FROM DETAILS
  2. WHERE LOGINTIME BETWEEN '10-JUN-2008' AND '12-JUN-2008' AND
  3. EMPID IN
  4. (SELECT EMPID FROM EMPLOYEE)
  5. GROUP BY 1

That's closer to what you need. You don't need to select empcode, empname and stuff. Change detailid for a column that can be grouped. I believe i need to see a sample table structure and better detail.
Jun 16 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.