|
-
Jun 6th, 2008, 06:12 AM
#1
Thread Starter
Lively Member
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!!!
-
Jun 6th, 2008, 07:39 AM
#2
Hyperactive Member
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.
-
Jun 6th, 2008, 07:41 AM
#3
Thread Starter
Lively Member
Re: Tips in making TIME KEEPING System
Im using MS Access 2007 as my database, will it work there?
-
Jun 6th, 2008, 07:50 AM
#4
Hyperactive Member
Re: Tips in making TIME KEEPING System
-
Jun 6th, 2008, 07:53 AM
#5
Thread Starter
Lively Member
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.
-
Jun 6th, 2008, 07:55 AM
#6
Hyperactive Member
Re: Tips in making TIME KEEPING System
If everything is resolved mark thread resolved (thread tools - Mark thread resolved)
-
Jun 6th, 2008, 08:23 AM
#7
Thread Starter
Lively Member
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
-
Jun 6th, 2008, 08:38 AM
#8
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|