468,512 Members | 1,562 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

count record with same value of field1 with field2 are also same value

Good Day

Just wanted to ask for any help on how could I count a record depending on the value of the two column. Example below table i need to count the productivity of the agent for march 1 for each telno and for march 2 for each number.
the rule is 1 productivity per telno per day. Even they encoded many data for same telno still it count 1.

SQL = SELECT ACTION_DATE, COUNT(DISTINCT ACTION_RECNO) FROM WEB_ACTIONDETAILSDONE WHERE ACTION_USER like '%" & sagent & "%' AND ACTION_DATE BETWEEN #" & fdate & "# and #" & tdate & "# GROUP BY ACTION_DATE;"


telno date user
111 1-Mar agent 1
222 1-Mar agent 1
333 1-Mar agent 1
111 1-Mar agent 1
333 1-Mar agent 1
222 2-Mar agent 1
444 2-Mar agent 1
444 2-Mar agent 1
111 2-Mar agent 1
333 2-Mar agent 1

the result should be
march 1
agent - 3

march 2
agent - 4

thank you in advance

RJ
Mar 31 '10 #1
1 1366
jhardman
3,405 Expert 2GB
This is a database question, not an ASP question. please tell me what type of db it is, and I will put it in the correct forum (access, SQL Server, MySQL, Oracle, etc).

Jared
Mar 31 '10 #2

Post your reply

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

Similar topics

4 posts views Thread by ZyPhiX | last post: by
2 posts views Thread by Paolo | last post: by
3 posts views Thread by Abhi | last post: by
1 post views Thread by sunilkeswani | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.