Results 1 to 8 of 8

Thread: Tips in making TIME KEEPING System

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Philippines
    Posts
    70

    Tips in making TIME KEEPING System

    Good day.

    Im a new user of VB.net, i just want to get the total hours an employee attended. For example, an employee checks In at 11:30 PM in the evening and Checks Out the next day at 8:30 AM in the morning.


    I just need the total hours and minutes... THANKS!!!

  2. #2
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: Tips in making TIME KEEPING System

    See help for TimeSpan.

    Use DateTime var for both times/dates and substract them.

    EDIT:
    Here is a sample:
    Code:
    Dim oDt1 As DateTime = first.Value 'datetime picker 1
    Dim oDt2 As DateTime = second.Value 'datetime picker 2
    Dim oDtDiff As TimeSpan = oDt2.Subtract(oDt1)
    Dim hours As Integer
    Dim minutes As Integer
            hours = DateDiff(DateInterval.Hour, first.Value, second.Value)
            minutes = DateDiff(DateInterval.Minute, first.Value, second.Value)
            
    Me.txtDiffSec.Text = oDtDiff.ToString 'textbox where result with seconds goes  (05:45.23.295468)
    Me.txtDiff.Text = hours & ":" & Math.Round(((minutes / 60) - hours) * 60, 0) 'text box for mins:sec (05:45)
    Last edited by Zeljko; Jun 6th, 2008 at 07:49 AM.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Philippines
    Posts
    70

    Re: Tips in making TIME KEEPING System

    Im using MS Access 2007 as my database, will it work there?

  4. #4
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: Tips in making TIME KEEPING System

    I dont see a problem

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Philippines
    Posts
    70

    Re: Tips in making TIME KEEPING System

    Thank you very much, i'll try it, i'll just have to finish the sample data inputs.

  6. #6
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: Tips in making TIME KEEPING System

    If everything is resolved mark thread resolved (thread tools - Mark thread resolved)

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2008
    Location
    Philippines
    Posts
    70

    Smile Re: Tips in making TIME KEEPING System

    How about using the Datagrid view object, how can i create a simple connection to the database? Im sorry, it's my first time to use VB.net I'm much famillar in VB 6.0 but i need to learn this .net also.. Thanks

  8. #8
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: Tips in making TIME KEEPING System

    Sorry, dont know how to help you with that. I'm also at beginning with VB.net. Maybe will someone else answer to this question, but I sugest that you make a search first in this forum, than in MSDN, then Google

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width