I have a table below, I would like to count the eID by group to know how many eID group will 115 have. So, it is suppose to have 3 groups:X (1), Y(2) and z(1). In the end, recordcount will show there are 3 groups for eID refer to ID 115.
TblX
ID eID COUNT(eID)
115 X -------> 1
115 Y -------> 2
115 Y
116 Y
115 Z ------> 1
Code snippet:
Set wRS = Server.CreateObject("ADODB.Recordset")
sql1="SELECT eID,COUNT(eID) AS count FROM TblX GROUP BY eID WHERE ID='"&ID&"'"
wRS.Open sql1,wCON,1,1,1
But it shows: Syntax error (missing operator) in query expression 'eID WHERE eID='115''.
I wonder what could be wrong. Any help is very much appreciated.
TblX
ID eID COUNT(eID)
115 X -------> 1
115 Y -------> 2
115 Y
116 Y
115 Z ------> 1
Code snippet:
Set wRS = Server.CreateObject("ADODB.Recordset")
sql1="SELECT eID,COUNT(eID) AS count FROM TblX GROUP BY eID WHERE ID='"&ID&"'"
wRS.Open sql1,wCON,1,1,1
But it shows: Syntax error (missing operator) in query expression 'eID WHERE eID='115''.
I wonder what could be wrong. Any help is very much appreciated.