0

experts please help on querying and counting the frequency of data, i want to count the number of data appearance then put it on like this:

Name----Lastname----Relationship----Freq
Egie----Tayag-------Brother---------2

i will place the result on a report counting the number of a person's visit on the theme park. TIA ^_^

SELECT relfirstname, rellastname, relrel, count(*) AS kamote FROM RelativeTable WHERE effectivedate = #" & frmNew.DTPicker2 & "# AND empnumber = '" & frmNew.empnotxt.Text & "' GROUP BY rellastname
2
Contributors
2
Replies
10
Views
4 Years
Discussion Span
Last Post by 2mhzbrain
0

I think this should work:

SELECT 
    relfirstname, rellastname, relrel, count(*) AS kamote 
FROM
    RelativeTable 
WHERE
    effectivedate = '" & frmNew.DTPicker2.Value.ToString() & "' AND 
    empnumber = '" & frmNew.empnotxt.Text & "' 
GROUP BY 
    relfirstname, rellastname, relrel
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.