How do I add all time values in a database table to get its total, get the total tardiness then sum up to know how many days an employee is absent or present in a monthly basis?
Come up with an idea and we'll help you fine tune it.
Here's what i have at the moment.
Private Sub Compute() 'lblhuam.Caption = DateTime.DateDiff("H", lbliam.Caption, lbloam.Caption) 'lblhupm.Caption = DateTime.DateDiff("H", lblipm.Caption, lblopm.Caption) Dim Totam As String Dim Totpm As String Dim Totall As String Con "Database.mdb" With RecSet .Open "Select * from TimeLog where ID =" & Text1.Text, DBLink, adOpenKeyset, adLockPessimistic While .EOF = False lbldate.Caption = .Fields("DATE_LOG").Value If IsNull(.Fields("IN_AM")) = True Then lbliam.Caption = "" Else lbliam.Caption = .Fields("IN_AM").Value End If If IsNull(.Fields("OUT_AM")) = True Then lbloam.Caption = "" Else lbloam.Caption = .Fields("OUT_AM").Value End If If IsNull(.Fields("IN_PM")) = True Then lblipm.Caption = "" Else lblipm.Caption = .Fields("IN_PM").Value End If If IsNull(.Fields("OUT_PM")) = True Then lblopm.Caption = "" Else lblopm.Caption = .Fields("OUT_PM").Value End If Totall = Totpm + Totam Totam = Hour((.Fields("OUT_AM")) - (.Fields("IN_AM"))) Totpm = Hour((.Fields("OUT_PM")) - (.Fields("IN_PM"))) lblhuam.Caption = Totam lblhupm.Caption = Totpm lblmuam.Caption = Val(Totam) + Val(Totpm) .MoveNext Wend .Close End With DBLink.Close End Sub
But it only computes the 2 fields. I would like to compute all the total hours of that employee for the whole 1 month.
Are you able to help answer this sponsored question?
Questions asked by members who have earned a lot of community kudos are featured in order to give back and encourage quality replies.
hi i am using vb.net multidimensional arrays and i am getting the nearest or closest number i just want to ask if my code was correct or not ? for example i have an input of 13000 and nearest number should be on col 6 can you please help me ...
I am developing a simple job card creator application with VB.net 2012, using Access 2010 as database.
The code I have generated to write data from a datagridview to the database table is successfully saving the data, but with an error "Parameter @name has no default value". The ...
write a C++ program which take inputs from the user/keyboard and calculate his ZAKAT.
get the input from user may include
-Amount invested in business
-Amount given to other business partners as loan
-Amount payable to others