Hi All,
Iam writing a query from Windows form application to access db to retrieve records .
The sample table format is shown below
SeatNumber EmpID Month
AXGFG123 298029 3
AXGFG123 298038 3
CALBN154 298085 3
CALBN154 298085 3
CALBN154 298085 3
CALBN154 298085 3
TIT9AA098 301772 3
TIT9AA098 301773 3
If same seat no is allocated to two different employees i need to pull those records alone
output should be
AXGFG123 298029 3
AXGFG123 298038 3
TIT9AA098 301772 3
TIT9AA098 301773 3
So to pull those seats which are allocated to 3 or more people i used the following query
Select seat.SeatNumber FROM Seat INNER JOIN [SELECT seat.EmpID ,seat.SeatNumber FROM Seat WHERE Month =" & month GROUP BY seat.SeatNumber,seat.EmpID HAVING (COUNT(seat.SeatNumber) >3)]. as v1 ON seat.SeatNumber = v1.SeatNumber
However iam unable to get the unique ID ,
my output is as follows which is not needed
CALBN154 298085 3
CALBN154 298085 3
CALBN154 298085 3
CALBN154 298085 3
Can someone please help me as iam stuck here for last 3 days
Iam writing a query from Windows form application to access db to retrieve records .
The sample table format is shown below
SeatNumber EmpID Month
AXGFG123 298029 3
AXGFG123 298038 3
CALBN154 298085 3
CALBN154 298085 3
CALBN154 298085 3
CALBN154 298085 3
TIT9AA098 301772 3
TIT9AA098 301773 3
If same seat no is allocated to two different employees i need to pull those records alone
output should be
AXGFG123 298029 3
AXGFG123 298038 3
TIT9AA098 301772 3
TIT9AA098 301773 3
So to pull those seats which are allocated to 3 or more people i used the following query
Select seat.SeatNumber FROM Seat INNER JOIN [SELECT seat.EmpID ,seat.SeatNumber FROM Seat WHERE Month =" & month GROUP BY seat.SeatNumber,seat.EmpID HAVING (COUNT(seat.SeatNumber) >3)]. as v1 ON seat.SeatNumber = v1.SeatNumber
However iam unable to get the unique ID ,
my output is as follows which is not needed
CALBN154 298085 3
CALBN154 298085 3
CALBN154 298085 3
CALBN154 298085 3
Can someone please help me as iam stuck here for last 3 days