Hussein El Sibai
Hussein El Sibai

Reputation: 53

How to create a query that will call your view

I created this view called [Vendors List] need help on creating a query that would call that vendors list here's the code for the CREATE VIEW:

CREATE VIEW [Vendors List] 
AS
    SELECT 
        VendorID, 
        SUM(InvoiceTotal) AS [YTD Invoice Total], 
        SUM(PaymentTotal) AS [YTD Payment Total], 
        SUM(CreditTotal) AS [YTD Credit Total]
    FROM 
        dbo.Invoices
    GROUP BY 
        VendorID

Upvotes: 0

Views: 39

Answers (2)

Devmati Wadikar
Devmati Wadikar

Reputation: 189

select * from ['Vendors List']

Upvotes: 0

Anand
Anand

Reputation: 1123

I can't believe you created the view based on your question but here you go:

select * from [Vendors List]

Upvotes: 1

Related Questions