Test the procedure by running the following execution statements , Exec spEmpTotals Exec spEmpTotals 'M% (This SP
Fantastic news! We've Found the answer you've been seeking!
Question:
Test the procedure by running the following execution statements ,
Exec spEmpTotals
Exec spEmpTotals 'M%
Transcribed Image Text:
(This SP will return a total of all hours an employee has worked during a given time period) Create a stored procedure named spEmpTotals that includes 3 input variables: @LastName (varchar(50)) @StartDate (smalldatetime) @EndDate (smalldatetime) Initially set LastName so that it defaults to returning every record if no value in input and set the 2 date variable to NULL. Next, test for null values in the date variables, if null is present, set both variables to the appropriate MIN or MAX value that exists in the PerFrom column of PayPeriod. Select the following columns: EmpName (concatenation of FirstName and LastName with a space between) TotWkHours (sum of WorkHours column) TotHolHours (sum of HolHours column) TotSickHours (sum of SickHours column) TotVacHours (sum of VacHours column) TotPersHours (sum of PersHours column) Filter the results where LastName is like the appropriate input variable and PerFrom column is valued between the two appropriate input variables. Group the query accordingly and sort the results by TotWkHours from largest to smallest (This SP will return a total of all hours an employee has worked during a given time period) Create a stored procedure named spEmpTotals that includes 3 input variables: @LastName (varchar(50)) @StartDate (smalldatetime) @EndDate (smalldatetime) Initially set LastName so that it defaults to returning every record if no value in input and set the 2 date variable to NULL. Next, test for null values in the date variables, if null is present, set both variables to the appropriate MIN or MAX value that exists in the PerFrom column of PayPeriod. Select the following columns: EmpName (concatenation of FirstName and LastName with a space between) TotWkHours (sum of WorkHours column) TotHolHours (sum of HolHours column) TotSickHours (sum of SickHours column) TotVacHours (sum of VacHours column) TotPersHours (sum of PersHours column) Filter the results where LastName is like the appropriate input variable and PerFrom column is valued between the two appropriate input variables. Group the query accordingly and sort the results by TotWkHours from largest to smallest
Expert Answer:
Answer rating: 100% (QA)
To create the stored procedure spEmpTotals and test it with the provided execution statements you ca... View the full answer
Related Book For
Auditing a business risk appraoch
ISBN: 978-0324375589
6th Edition
Authors: larry e. rittenberg, bradley j. schwieger, karla m. johnston
Posted Date:
Students also viewed these databases questions
-
What challenges did Coca-Cola face during the planning selection of a software vendor?
-
The following additional information is available for the Dr. Ivan and Irene Incisor family. The Incisors own a rental beach house in Hawaii. The beach house was rented for the full year during 2012...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
A three-dimensional elasticity problem of a uniform bar stretched under its own weight gives the following strain field: where A and B are constants. Integrate the strainedisplacement relations to...
-
Disks of polycarbonate plastic from a supplier are analyzed for scratch and shock resistance. The results from 100 disks are summarized as follows: Shock resistance High Low Scratch high 70 9...
-
What is the purpose or purposes of Form 8-K filings by SEC registrants? What specific items of information must be included in an 8-K that announces a change in audit firms?
-
An airplane flies at \(150 \mathrm{~km} / \mathrm{hr}\). (a) The airplane is towing a banner that is \(b=0.8 \mathrm{~m}\) tall and \(\ell=25 \mathrm{~m}\) long. If the drag coefficient based on area...
-
On March 20, Batavia's petty cash fund of $100 is replenished when the fund contains $9 in cash and receipts for postage $52, freight-out $26, and travel expense $10. Prepare the journal entry to...
-
A ship sets sail from Rotterdam, The Netherlands, heading due north at 9.00 m/s relative to the water. The local ocean current is 1.51 m/s in a direction 40 north of east. What is the velocity of the...
-
XYZ is a calendar-year corporation that began business on January 1, 2020. For the year, it reported the following information in its current-year audited income statement. Notes with important tax...
-
1. Draw the payoff diagrams below labeling the axis with the correct profit or loss amounts. a. Purchase of Microsoft common stock or take long stock position at $79 b. Long put position on Microsoft...
-
In June 2003, an investor is convinced that the SUPER BIO share price will be at least $60 on the third Friday of October 2003. To take advantage of this situation, while reducing his risk, he...
-
Parker Products manufactures a variey of household products. The company is considering introducing a new detergent. The companys financial manager has collected the following information about the...
-
The continuously compounded yield curve is y(T) = 0.04 0.03e-0.47 (a) What is the yield on a zero-coupon bond that matures in 3 months? Express your answer as a percent, to the nearest basis point....
-
Telefonica, a spanish conglomerat, with 30% revenues in Spain, 20 % in Germany, 20% in Brazil, 15% Mexico and United States respectively is considering undergoing a merger with Amrica Mvil, the...
-
-1 What is the mass of methane in the mixture? (AcombH for methane - 802.5 kJ mol and for propane - 2043.9 kJ mol-).
-
Name Max Alpha Bravo Charlie Delta Assn1 10 5 2 0 9 Assn2 10 9 2 4 6 Assn3 10 6 0 0 0 Assn4 10 8 2 0 0 Assn5 10 9 0 3 3 Numbers may change as you enter formulae. However, the formula would be the...
-
Find the image of x = k = const under w = 1/z. Use formulas similar to those in Example 1. y| y = 0 -21 -2 -1 -1, /1 12 T -1 -1 y= -2 x =0
-
It has been generally asserted that a standard of due care was sufficient to meet the negligence standard. Yet the chapter also indicates that the court system has been an influence on the...
-
Why is it so important that a sample be as representative of the population as possible?
-
A CPA's audit documentation contains a narrative description of a segment of the Crayden Factory, Inc., payroll system and an accompanying flowchart as follows: ¢ The internal control structure...
-
The treatment of outflows on account of dividend and interest is highly debatable as to their activity classification. Give a serious thought to the issue and express your opinion about the best...
-
Reliance Industries Ltd. is the biggest private sector company in India. The following fact sheet about the company and its peer group, as extracted from Capitaline Plus database is reproduced in the...
-
Consider the same setting as Problem 18, but suppose instead 80% of the shareholders redeem their shares, and no warrants are exercised. Data from problem 18 a. What is the amount of cash per share...
Study smarter with the SolutionInn App