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

  • Home
  • SEARCH
  • 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 4006006
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:27:46+00:00 2026-05-20T08:27:46+00:00

I have a table which holds clocking in/out records for every user : RecID

  • 0

I have a table which holds clocking in/out records for every user :

RecID   User    In/Out  ClockInOutTime
8      1       IN      25/02/2011 09:36:44
9      1       OUT     25/02/2011 11:36:44
10    1       IN      25/02/2011 12:36:44
11    1       OUT     25/02/2011 17:36:44
12    1       IN      26/02/2011 00:00:00
13    1       OUT     26/02/2011 12:00:00
14    1       IN      26/02/2011 09:00:44
15    1       OUT     26/02/2011 12:36:44

Any ideas how I can work out the total time worked for every month using LINQ?

cheers

  • 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-20T08:27:47+00:00Added an answer on May 20, 2026 at 8:27 am

    This is non-trivial to do in either Linq or SQL. There is no easy way to link each OUT record with the corresponding IN record in SQL.

    You have two options:

    1. Querying the data and calculating in code within a for loop.
    2. Changing the table schema like: RecID, User, ClockInTime, ClockOutTime

    Option 1 is easy to implement, but I would seriously consider option 2. How do you define in your business rules that each IN record must be followed by a corresponding OUT record (or be last record)?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table which holds flight schedule data. Every schedule have an effective_from
If you have a table which holds history (updates, deletes) from another table, how
Situation: In my database I have a table in which records may reference other
I have a table which holds information on television programs and I want to
I have a table which holds contact details against corresponding account numbers: Contacts_Accounts Table
I have a table which holds ~1M rows. My application has a list of
HI I have a table which holds files and their types such as CREATE
I have a database which holds URL's in a table (along with other many
I have a table in mysql which holds the values in integers, my table
I have one table in my core data source which holds some articles with

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.