12/25/2023 0 Comments Time clock 2004![]() ![]() Historically, there were no uniform rules for DST from 1945 to 1966. The law does not affect the rights of the states and territories that choose not to observe DST. The current schedule was introduced in 2007 and follows the Energy Policy Act of 2005.Īccording to section 110 of the act, the US Department of Transportation (DOT) governs the use of DST. ![]() United States has observed DST for 106 years between 19 (DST in at least one location).ĭaylight Saving Time (DST) in the USA starts on the second Sunday in March and ends on the first Sunday in November.United States first observed Daylight Saving Time in 1918.Daylight Saving Time History in United States US dependencies do not use Daylight Saving Time (DST). Daylight Saving Time in Dependencies of USA Dependency Most of Arizona and Hawaii don't use DST. (51 in total, 48 where all observe DST, 1 which doesn't observe DST, 2 with parts on DST)ĭST in Other Locations in USA in 2004 (1 Location) Business Date to Date (exclude holidays)ĭST in States and Federal Districts in USA in 2004.I would consider it essential reading for anyone new here. Here's a handy article about How to Post to Get the Best Help. Since 1 is a "punch out", I'm filtering for those, and then I'm using LAG() to read the previous value for the same employee to get the punch_in value. Probably long-winded (I'm sure someone will shred it). Now that I've provided a CREATE TABLE script and an INSERT script, the only thing left is to run the code and then write a query to answer the question. LAG(punch_time,1) OVER (PARTITION BY employee_id ORDER BY punch_time ASC) END , DATEDIFF(minute, p.PrevPunch, p.punch_time) AS MinsWorked INSERT INTO punches (employee_id, punch_time, punch_type) VALUES I added a few extra records to make sure my LAG wasn't doing something silly. ![]() Here's a script to create the table and populate it with some data. I was wondering if anybody else was using a system similar to this one? Any design advice on pros and cons would be welcome from anyone. I can do Select XXX from dbo.Punch where FkEmploye = and DateFin is null. If he's in and it's been more than X hours, I do an automatic punch out for 12 hours of work and punch him in again.īut the query to check if he's in is much simpler. NOT NULL CONSTRAINT DEFAULT (getdate()),ĬONSTRAINT PRIMARY KEY CLUSTEREDĬONSTRAINT FOREIGN KEYĬONSTRAINT CHECK ( < or is null)įrom then I have a pretty straight forward PunchEmloye Stored Proc. However My table design is somewhat different that yours :ĬREATE TABLE (/* ya I now know better than that*/ I've created a similar system to count how much time I spend at work (I don't call it a punch because I can actually change the underlying data and I'm the only one using but it's basically a punch). WHERE (o.punchType = 0) AND (i.punchType = 1) AND (o.punchTime = SELECT i.employeeID, e.firstName, e.lastName, i.punchTime AS, o.punchTime AS, CONVERT(decimal, DATEDIFF(mi, i.punchTime,Ĭlock o ON i.employeeID = o.employeeID INNER JOIN Here are the tables I used: create table employee (id int, firstName varchar(20), lastName varchar(20)) goĬreate table clock (employeeID int, punchTime dateTime, punchType bit) go ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |