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 8401207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:44:46+00:00 2026-06-09T21:44:46+00:00

I am trying to write a Business Object report to show a list of

  • 0

I am trying to write a Business Object report to show a list of the people who have not returned a timesheet on a selected date, but I can’t figure out how to stop the SQL query returning multiple entries for individuals.

My Staff_Table contains 2 columns – Employee No & Name
My Timesheet_Table contains, among other things, Employee No & Week_Ending_Date.

I can easily write a statement to return all users who have entered a timesheet with a Week_Ending_Date of e.g. 10/08/2012. However, if I try to return a list of all those who have not enetered a timesheet for 10/08/2012, I pick up every single timesheet in the table which does not have that date, so, for example, if a person has submitted 100 timesheets and only 1 of them is for 10/08/2012, the results will show him 99 times.
What I need is a fixed list of everyone on the Staff_Table who has not submitted for that date, showing once only.

I tried a Union with NOT EXISTS but either I’m doing it wrong or it simply isn’t appropriate.

Can anyone point me in the right direction?

  • 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-06-09T21:44:48+00:00Added an answer on June 9, 2026 at 9:44 pm

    Try adding DISTINCT to your query

    ie

    SELECT DISTINCT ...
    

    Your query should look something like

    SELECT * 
    FROM Staff
    WHERE NOT EXISTS 
    (
        Select EmployeeNo 
        from Timesheet 
        where WeekEndingDate='2012-08-10'     
        and TimeSheet.EmployeeNo  = Staff.EmployeeNo 
    )
    

    or

    SELECT * 
    FROM Staff
    WHERE EmployeeNo NOT IN 
    (
        Select EmployeeNo 
        from Timesheet 
        where WeekEndingDate='2012-08-10'
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I am trying to create a copy of a business object I have
Trying to write a function to see how often an object exists and give
I am trying to write requirements for a multi-step business process (via a wizard).
I am trying to write an app that will have a web interface for
I am trying to write a dynamic form using PHP. I'd like to have
I am trying to write a view helper but it's not returning the correct
I am trying write a script where when a user clicks on a link,
I m trying write code that after reset set up rrpmax as 3000. It
I am trying write a function that generates simulated data but if the simulated
Trying to write app for service technicians that will display open service calls within

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.