Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

GO CREATE VIEW vwPaymentSummary AS SELECT COUNT(BookingID) AS TotalBookings, CONCAT(FirstName, ' ', LastName) AS CustomerFullName, CustomerEmail, CustomerPhone, StartDate, EndDate, DATEDIFF(dd, StartDate, EndDate) * Rate AS

GO CREATE VIEW vwPaymentSummary AS SELECT COUNT(BookingID) AS TotalBookings, CONCAT(FirstName, ' ', LastName) AS CustomerFullName, CustomerEmail, CustomerPhone, StartDate, EndDate, DATEDIFF(dd, StartDate, EndDate) * Rate AS FullAmount, SUM(DATEDIFF(dd, StartDate, EndDate)) AS TotalPayments FROM Booking AS b JOIN Customer AS c ON b.CustomerID = c.CustomerID;


Msg 8120, Level 16, State 1, Procedure vwPaymentSummary, Line 2 [Batch Start Line 29] Column 'Customer.FirstName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. Msg 8120, Level 16, State 1, Procedure vwPaymentSummary, Line 2 [Batch Start Line 29] Column 'Customer.LastName' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

How do i fix the errors?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Law Text and Cases

Authors: Kenneth W. Clarkson, Roger LeRoy Miller, Gaylord A. Jentz, F

11th Edition

324655223, 978-0324655223

More Books

Students also viewed these Databases questions

Question

What made you decide on this subfield of psychology?

Answered: 1 week ago

Question

creating a cgpa calculator app using matlab

Answered: 1 week ago