stop time automatically

  • Hi Guys

    I have an application(v foxpro and sql server2000 as backend) which updates staff worktimes.

    i have table worktime with following cols

    wtid , startdate ,starttime ,stopdt ,stoptime

    when user clicks start first 3 cols will be inserted with

    current date & time.if user clicks stop btn last cols

    will be updated with current date & time.

    what happens is sometimes user forgets clicking stop btn

    before leaving office.so stopdt ,stoptime cols wont be updated .these should be updated bcoz user no longer working.he's gone home.

    i want to update those 2 cols when time is say 6.30pm (if

    those cols not updated )automatically.

    i cannot use a trigger for this .can i? bcoz there wont be

    new inserts/updates into the table since no body working.

    how do i achieve what i want?

    i believe u understood my question

    Thank you very much Ideas

    cheers

    Rajani

     

  • Open Enterprise Manager and use SQL Server Agent to schedule a job to do the update.

    Any other suitable scheduler running on an application server which connects to the database can be used.

    Perhaps you should also consider leaving the field null, indicating that the user has forgotten to sign off (and disallowing him/her to sign off the following day).

  • That sounds like a good idea..

    Also, I'm wondering - is it impossible for anyone to do over-time?

    (I have no idea what job is monitored here, but...)

    ..what if someone does extra-time (ie is still at work) and you just decide that he/she isn't.???

    =;o)

    /Kenneth

  • To add to Kenneth, this is what happens here.

    At 8:00 PM our time recording system stops, well, err recording my time. So 8:00 PM is recorded as my check.out time. Normally that's no problem with me, as I am at home, but sometimes I am not. For this cases I need to prove to the HR department that I really was working after 8:00 PM. So, I need to file an application and have it signed by my CFO and give this to the HR girls They then go ahead and correct manually my working time for that day in the system.

     

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • A lot of "manual labor" in an automated world

    I've developed the Time-Tracking system for my job which handles everything and even keeps track of time against Projects...a very big system developed single-handedly ...I now have fewer Brain cells and some gray hairs at the ripe old age of 26 !

    Anyway, since the Salary employees here do not use a Time Clock to "punch-in / punch-out" (i.e. They have PCs), I had a C++ programmer here help me design a super-simple DLL that detects when a PC is turned on, turrned-off, Locked, or when a Screen Saver comes on (This is NOT a Windows Service!).  The data obtained from that information is placed into an XML file which later gets imported into an "Activty Audit" table.  This table is then used by the Payroll Dept to determine if an employee is being over-zealous in their Time Tracking (since we never say "You MUST go home at 5:00PM!").  An Employee can work as many hours as they want...they're Salary mostly anyway !  For hourly employees, someone does do the manual entry of the Time Card audit by keying the data from the "punched" time cards (since the hourly employees work in a Production environment and do not have PCs).

    Anyway, you could write a DLL that does the same thing and Detects when the PC "Sleeps" or the "ScreenSaver" comes on.  Or, require your Users to at least "Lock" their PCs or "Shutdown" at night.  The DLL will record all those Times when the Events happen, and you can import them into SQL Server later !

    Just do a Search on MSDN on "WinLogon".  Read up on it to understand more (you do NOT need to write a GINA DLL!).  Then, have a C++ programmer take about 15 minutes and write the DLL!  All it needs to do is output a Text file or XML file.

  • To steal Kenneth' phrase: 'It depends..'

    I always look forward to have a reason to deal with the girls in our HR department. Guess why?  

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • You have a point there!

  • Thank you so much guys for your replies.

    If someone wants to work overtime no problem

    they click start btn again .My job is to stop

    worktime only once.if someone starts intentionally

    after office hours they have to click stop btn

    (atleast for now :wow

    I've not done any scheduling so far but it seems

    i need to explore on it.

    exciting

    cheers

    Rajani

  • Thank you very much Guys.

    I just created a new job which stops my worktimes automatically.

    all working fine

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply