Can someone help me consolidate this procedure into robust way. The procedure is working. I want to rewrite to make it readable for other developers.
Select EmployeeNumber, Hours, PTO, StartDate, EndDate, PreviousHours
INTO #FinalPayPeriodTable
From #TempAggregatedTable
Select EmployeeNumber, ((Hours - (Hours - 80)) - PreviousHours - PTO) AdjHours, Hours as OrgHours, PTO, StartDate, EndDate, PreviousHours
From #FinalPayPeriodTable
Set @hours = (Select ((Hours - (Hours - 80)) - PreviousHours - PTO) AdjHours From #FinalPayPeriodTable)
RETURN @hours
13 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
David SmithPosted Dec 10, 2015, 7:53 AM
Francis SusaimichaelPosted Dec 10, 2015, 7:19 AM
David SmithPosted Dec 10, 2015, 6:48 AM
Francis SusaimichaelPosted Dec 10, 2015, 6:34 AM
David SmithPosted Dec 10, 2015, 5:50 AM
Francis SusaimichaelPosted Dec 10, 2015, 4:15 AM
David SmithPosted Dec 9, 2015, 10:22 AM
Francis SusaimichaelPosted Dec 9, 2015, 4:20 AM
INTO #FinalPayPeriodTable
From #TempAggregatedTable;
Set @hours = (Select ((Hours - (Hours - 80)) - PreviousHours - PTO)AdjHours From #FinalPayPeriodTable);
RETURN @hours;
David SmithPosted Dec 9, 2015, 3:04 AM
Francis SusaimichaelPosted Dec 9, 2015, 2:52 AM
David SmithPosted Dec 9, 2015, 2:17 AM
David SmithPosted Dec 9, 2015, 2:17 AM
Francis SusaimichaelPosted Dec 9, 2015, 2:06 AM
INTO #FinalPayPeriodTable
From #TempAggregatedTable;
Set @hours = (Select AdjHours From #FinalPayPeriodTable);
RETURN @hours;