These bumps in pay can really add up, especially when you factor in overtime pay. It’s common for companies to incentivize employees to work second and third shifts with increased pay. Even though there are too many reasons to list that support taking a second or third shift, here are 14 reasons why a second or third shift is the way to go! Shift Premiums Working at an unconventional time can have positive effects on your work life balance – if you take advantage of them. Second and third shift positions tend to be less popular than a typical day shift however, there are plenty of benefits of taking the shift less traveled. SELECT '20','B101120308',' 1:51:42 AM','16','2'īased on a similar table, adding a column to the schema for shift number ('1' being 1st shift,'2' being 2nd shift ,'3' being 3rd shift).Top 14 Reasons You Should Accept That Second or Third Shift Opportunity Tuesday, June 21, 2022 (HeaderID, SerialNumber, DateTested, OperatorID, StationID) (HeaderID INT IDENTITY(1,1) PRIMARY KEY CLUSTERED, IF OBJECT_ID('TempDB.#mytable','U') IS NOT NULL It will show you how to post the information I have requested. I'll agree that it should be rewritten, but I also think we need to ppoint out the error in the basic logic.Ĭdelgross, if you would like better answers to solving this problem, please post the DDL for the table(s) involved, sample data for the table(s), and expected results based on the sample data.Īlso, please be sure to read the first article I reference below in my signature block regarding asking for help. ![]() Get rid of the case statements, use a "proper" methodology to get the shift numbers, and store that in a column. Yes, but my feeling was that it has to be rewritten anyway. Also, there will be nothing selected for the second BETWEEN clause as it is doing BETWEEN 16 and 1. GROUP BY CASE WHEN DATEPART(hour,(DateTested)) between 7 AND 16 THEN '1st SHIFT'ĭoes anyone else see a problem with this code? If not, take a close look at the BETWEENs, there are going to be overlaps where the hour is 7, 16, and 1. ![]() WHEN DATEPART(hour,(DateTested)) between 1 AND 7 THEN '3rd SHIFT' WHEN DATEPART(hour,(DateTested)) between 16 AND 1 THEN '2nd SHIFT' This is not what I want, I want to actually sort the entire dataset by shift, place them in three different tables accordingly, and then be able to perform other sorts on those temp tables.ĬASE WHEN DATEPART(hour,(DateTested)) between 7 AND 16 THEN '1st SHIFT' Sounds simple enough, but for the life of me all I can do is an aggregate. Say 1st shift work from 7:00AM to 4:00PM, the Second shift works from 4:00PM to 1:00AM, and the 3rd shift works from 1:00AM to 7:00AM. Basically, I have data that has a datetime field in it and I would like to group the data into 3 different temporary tables sorted by the specific work shift, obviously grouped into 3 shifts at a given time. I have a request to sort a table by shift.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |