Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Volunteer Hours Volunteer ID Date and Time Started Date and Time Ended S-101 1/2

ID: 3909576 • Letter: V

Question

Volunteer Hours Volunteer ID Date and Time Started Date and Time Ended S-101 1/2/2012 8:00:00 AM 1/2/2012 5:00:00 PM S-101 1/9/2012 12:00:00 PM 1/9/2012 10:00:00 PM S-101 1/10/2012 10:00:00 AM 1/10/2012 6:00:00 PM S-102 1/2/2012 4:00:00 PM 1/2/2012 10:00:00 PM S-102 1/10/2012 9:00:00 AM 1/10/2012 5:00:00 PM S-103 1/4/2012 9:00:00 AM 1/4/2012 8:00:00 PM S-104 1/8/2012 7:00:00 AM 1/8/2012 3:00:00 PM Report 1 Create a report called Volunteer Awards. First create a query that shows the last and first names of volunteers, their length of service, and their award. The Length as a Volunteer field is a calculated field in the query, and the Award field requires an IF statement. Use the following rule: If volunteers have more than seven years of service, they receive a gold pen. Otherwise, they get a silver pen. Save the query as Volunteer Awards, and then bring the query into a report with the same title. Your data will differ, but the output should resemble that in Figure 5-9 Volunteer Awards Volunteer Awards First Name Award Gold Pen Gold Pen Gold Pen Gold Pen Gold Pen Silver Pen Silver Pen Silver Pen Silver Pen Silver Pen Last Name Webster Luke Ward Meartz Maria Luis Seever Seals Doorey Patt Leon FIGURE 5-9 Volunteer Awards report

Explanation / Answer

If you have any doubts, please give me comment...

SELECT [Last Name], [First Name], iif(DATEDIFF(year, Date(), [Start Date])>7, "Gold Pen", "Silver Pen") AS Award

FROM Volunteers V

WHERE V.[Volunteer ID] = VH.[Volunteer ID];