Home      Ask a Question      My Stuff      Help   
  
Scripting - ISFIRSTTODAY and ISLASTTODAY

These two keywords look for exactly what it says. They are test conditions to test for the first punch of the day (ISFIRSTTODAY)and the last punch of the day (ISLASTTODAY).

An example would be, say you have employees that work from 9:00am till 5:00pm and everything after would be OT. Now you want to test to see if the last punch of the day for any employee was after 5:00pm and if so through out an exception stating he clocked out late. You could use the "ISLASTTODAY" script like below:

if (islasttoday)
{
if (outtime > 5:00pm)
{
exception " Employee Clocked Out Late";
}}

How about using the same example of an employee working from 9-5 but now testing if they came in to early:

if (isfirsttoday)
{
if (intime < 9:00am)
{
exception " Employee Clocked Out Late";
}}

You can also script interior punches by checking for a false statement like the below example:

if (isfirsttoday = false)
{
if (outtime > 11:00am);
{
exception = "Employee Left Late For Lunch";
}}

So in this example the employee is supposed to clock out for lunch before 11:00am, but if he/she does not he gets the exception "Employee Left Late For Lunch".


ID
561
Category
Training
  FAQ's
Date Created
5/9/2011 2:40:35 PM
Date Updated
5/9/2011 3:00:47 PM
Back to Search Results