Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4017868
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:54:49+00:00 2026-05-20T09:54:49+00:00

I have a table which basically contains a Person_ID, Action, TimeStamp and using Microsoft

  • 0

I have a table which basically contains a Person_ID, Action, TimeStamp and using Microsoft ReportBuilder I have a report which tables each Person and the COUNT for their Actions.

Person     Action X       ActionY
1             3              5
2             0              4

Now I need to filter the results to only show people in a certain group which is defined by another table containing Person_ID, Group_ID.

When I do a JOIN and filter results based on the Group_ID = x the counts are very high, although it does filter correctly.

I run the query manually in SQL Server Manager and it is returning the same row multiple times?

EDIT:

My current SQL is

select t1.personid, t1.action, t2.personid, t2.groupid 
from t1 
inner join t2 on t1.personid = t2.personid 
where t2.groupid = 1

This returns each line multiple times, forgetting the count part as this is in the report builder I would like to understand why the same row is returned multiple times as this is what breaks the report.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:54:50+00:00Added an answer on May 20, 2026 at 9:54 am

    Do a DISTINCT

    SO..

    SELECT PersonID, ActionX = COUNT(distinct varname), ActionY = SUM(distint varname)
    FROM tblName1 a
    INNER JOIN tblName2 b ON a.PersonID = b.PersonID
    WHERE b.Group_ID = 'groupvar' 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a mySQL table which contains rows based on payments. Each row contains
I have a table in my MySQL DB which basically contains cron-like tasks. Basically
Basically, I have a table which contains a few properties for a company. This
Basically, I have a table called document which contains a column named as host.
Basically I have a table which is used to hold employee work wear details.
Can we have a SQL query which will basically help in viewing table and
I have a table which is referenced by foreign keys on many other tables.
I have a table which contains my server status create table ServerStatus ( ServerId
I have a table which has several one to many relationships with other tables.
I have a table which needs to link one of three seperate tables, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.