Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Pulling dates and Summing and avaatge the totals;

    I'm worling on a small project the keeps time keeping for my staff. I have gave my staff a specific id's and set-up the relationships in an access database.

    The problem I have is I can't work out the reporting . I need help in puling a date range and taking a total of how mins late thye are and on who average or late they are. I have been playing about with scripts for while but know I'm way off.

    Can any help?
    Kind regards,
    Mike Hughes

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Stillwater Ok
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure what your asking.

    Are you wanting a way to report on who has been the latetest?
    Are you wanting to give an average of how late your employees are?

    What type of report are we looking for? What is the end result we desire?
    when we look at the report, what do we want to learn from it?
    "Never offend people with style when you can offend them with substance."
    --Sam Brown

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts
    I need to pull a weekly report on who was late. And it would be good to see on avargae who was late monthly.

    If I get some help on how to pull this info, i think i can work out the rest myself. I managed to work out this

    Code:
    <!--#INCLUDE file="pull_drop_down_name.asp"-->
    <%
    'Dimension variables
    Dim adoCon 'Holds the Database Connection Object
    Dim rsReport 'Holds the recordset for the records in the database
    Dim strSQL 'Holds the SQL query for the database
    
    
    'Create an ADO connection odject
    Set adoCon = Server.CreateObject("ADODB.Connection")
    
    adoCon.Open = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database.mdb")
    
    NameID= Clng(request.QueryString("NameID"))
    
    'Create an ADO recordset object
    Set rsReport = Server.CreateObject("ADODB.Recordset")
    
    'Initialise the strSQL variable with an SQL statement to query the database
    
    'strSQL = "SELECT * FROM Data WHERE NameID=" & NameID & " ORDER BY Date_Late"
    
    strSQL = "SELECT SUM(Late) as DisplayTotal FROM Data WHERE NameID=" & NameID
    
    'Open the recordset with the SQL query 
    rsReport.Open strSQL, adoCon
    %>
    
    
    Total Mins Late: <% = rsReport("DisplayTotal")%>
    
    
    <%
    'Reset server objects
    rsReport.Close
    Set rsReport = Nothing
    Set adoCon = Nothing
    
    %>
    Kind regards,
    Mike Hughes

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Stillwater Ok
    Posts
    226
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How you report it really depends on how you have your database designed.

    I may select rows where login>date+08:00:00

    You could DateDiff() the login time with that mornings actual employee login.

    Do they clock in and out of this system, or it it typed in later?

    Forgive me if I sound like I'm grilling you. It just seems serendipitous that I start a system like this tomorrow. I thought I might gather a different perspective on how it may be done.
    Last edited by Eskimo; 01-19-2005 at 08:52 PM.
    "Never offend people with style when you can offend them with substance."
    --Sam Brown

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts
    The time keeping in manually ipputed by me. I pull the info the a call management system call "Ava" formally called Lucent
    Kind regards,
    Mike Hughes


  •  

    Posting Permissions

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