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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:35:42+00:00 2026-06-10T03:35:42+00:00

I am making a payroll system and I bought the B3 tft from zktechnology

  • 0

I am making a payroll system and I bought the B3 tft from zktechnology and would like to arrange the record.

Currently I can pull the data from the biometric with this format:

Count   EmpID   InOutMode   Date
1       1       0           8/20/2012 07:49:01
2       1       1           8/20/2012 12:08:21
3       1       0           8/20/2012 12:43:10
4       1       1           8/20/2012 17:56:15
5       2       0           8/20/2012 07:53:11
6       2       1           8/20/2012 12:02:01
7       2       0           8/20/2012 12:39:56
8       2       1           8/20/2012 17:20:43
9       1       0           8/21/2012 08:10:20
10      1       1           8/21/2012 12:01:26
11      1       0           8/21/2012 13:03:11
12      1       1           8/21/2012 17:11:15
13      2       0           8/21/2012 07:48:26
14      2       1           8/21/2012 12:14:58
15      2       0           8/21/2012 12:59:31
16      2       1           8/21/2012 17:20:12

InOutMode:

0 = In, 1 = Out

Now, I want to convert the data above like this:

EmpID   Date        AM_In       AM_Out      PM_In       PM_Out
1       8/20/2012   07:49:01    12:08:21    12:43:10    17:56:15
2       8/20/2012   07:53:11    12:02:01    12:39:56    17:20:43
1       8/21/2012   08:10:20    12:01:26    13:03:11    17:11:15
2       8/21/2012   07:48:26    12:14:58    12:59:31    17:20:12

So I can save it to the database with EmpID, Date, AM_In, AM_Out, PM_In, PM_Out fields.

I saw a similar code here before but I can’t remember the URL.

Update:

VB.net code or sql in ms access format is acceptable.

  • 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-10T03:35:43+00:00Added an answer on June 10, 2026 at 3:35 am

    It might be easiest to create two cross tabs and a query to join them to the available dates and employees.

    1 AM Crosstab

    TRANSFORM Min(tm.Date) AS MinOfDate
    SELECT Format([Date],"dd/mm/yyyy") AS dt, tm.EmpID
    FROM tm
    GROUP BY Format([Date],"dd/mm/yyyy"), tm.EmpID
    PIVOT tm.InOutMode;
    

    2 PM Crosstab

    TRANSFORM Max(tm.Date) AS MinOfDate
    SELECT Format([Date],"dd/mm/yyyy") AS dt, tm.EmpID
    FROM tm
    GROUP BY Format([Date],"dd/mm/yyyy"), tm.EmpID
    PIVOT tm.InOutMode;
    

    Where tm is the name of your table.

    You can then join these up.

    SELECT Alldates.dt, 
           Alldates.empid, 
           am.[0] AS [Am In], 
           am.[1] AS [Am Out], 
           pm.[0] AS [Pm In], 
           pm.[1] AS [Pm Out] 
    FROM   ((SELECT DISTINCT Format([date], "dd/mm/yyyy") AS dt, 
                            empid 
            FROM   tm) AS Alldates 
            LEFT JOIN am 
                   ON ( Alldates.empid = am.empid ) 
                      AND ( Alldates.dt = am.dt )) 
           LEFT JOIN pm 
                  ON ( Alldates.empid = pm.empid ) 
                     AND ( Alldates.dt = pm.dt ); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Making the transition from Vim to gVim, I would like to disable all toolbars
Making a ternary logic table, and I would like to make my own function
Im making a fairly big game for Mac appstore, and i would like to
Making an adobe flex ui in which data that is calculated must use proprietary
making a new jsp and got a mock-up from some analyst. Notice the sections
Making a flash page that can cycle through these three images on mouseclick. For
Making a search result list (like in Google) is not very hard, if you
Im making slide show with jquery How i can set interval between two function
Im making a collision checking system with jQuery however it doesn't seem to work.
Im am learning C# and am making a Payroll Add-On for SAP Business One.

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.