Tracing Time


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: Tracing Time

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    Tracing Time

    [Originally posted by scobra98]

    Hello,

    I m creating a school project.
    I m creating Teacher's Attendence
    I want that if teacher # 1 come on 8:00:00 then the remarks are "Regular" and if teacher # 1 come 8:15:00 then remarks are "Not Regular" OR if teacher #1 come on 8:30:00 then remarks are "Absent".

    Please help me
    Thanks


    Farooq

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Tracing Time

    [Originally posted by neophile]

    Select Case Format(dteTimeIn, "hh:nn")
    Case "08:00"
    strRemark = "Regular"
    Case "08:15"
    strRemark = "Not Regular"
    Case "08:30"
    strRemark = "Absent"
    End Select



    ... Like that, you mean?

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Tracing Time

    [Originally posted by m.posseth]

    hmmm sory neophile and what if the teacher comes om 8:01 :-) (get my point )


    it should have been a between statement

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Tracing Time

    [Originally posted by neophile]

    In what data type is the date your checking against? Is it in a Date? A string?

  5. #5
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Tracing Time

    [Originally posted by neophile]

    Oh yeah... and does 8:01 count as Regular or Not Regular? Or, like most time card machines, is this always in sets of 15 minutes?

  6. #6
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Tracing Time

    [Originally posted by m.posseth]

    hmmm maybe time card machines in europe are different cause the ones i know off

    count one hour in 100 pulses

    strange but true :-)

  7. #7
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Re:Tracing Time

    [Originally posted by neophile]

    I guess we're just a little more lenient over here ;)

  8. #8
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Tracing Time

    [Originally posted by scobra98]

    Hello Neophile and M.Posseth

    What did u decide after ur discussion.
    Should I do the following

    Select Case Format(dteTimeIn, "hh:nn")
    Case "08:00"
    strRemark = "Regular"
    Case "08:15"
    strRemark = "Not Regular"
    Case "08:30"
    strRemark = "Absent"
    End Select

    Will it work ?



  9. #9
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Tracing Time

    [Originally posted by m.posseth]

    it wil work


    if you have a time comparisation that is between 15 minutes ( like you use a automated timer that queries the procedure with that intervall ,,
    i.o.w. if it is 8:01 an your procedure queries with that value it wil not work :-)
    if your procedure walks through the procedure with value 8:00 until 8:15 is reached then it wil work, don`t know in how much hurry you are , but right at this moment my main development computer is out of order ( brand new monitor whent up in smoke :-( i could have nown that there should be something wrong to the brand SAMSUNG for everyone out there looking for a bargan in 19" monitors
    don`t buy a Syncmaster 955B from SAMSUNG !! :-)
    so i am now typing this behind my wifes computer
    ( she wil kill me if a take her monitor ;-)
    so on monday i wil have a new one for my own computer and i am ready to write something in code :-) ,,,,

  10. #10
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Tracing Time

    [Originally posted by neophile]

    The code is error-free, if that's what you mean. But it will work for your requirements? That's something for you to answer. Do you need it to handle in-between times? If so, that code is useless.

  11. #11
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:Re:Re:Tracing Time

    [Originally posted by neophile]

    Just use this... this will work in either case...



    Select Case dteTimeIn
    Case Is < CDate("08:15AM")
    strRemark = "Regular"
    Case Is < CDate("08:30AM")
    strRemark = "Not Regular"
    Case Else
    strRemark = "Absent"
    End Select

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center