Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm trying to create a sales invoice with multiple table. Here is my stored procedure.

ALTER PROCEDURE CreateInvoice

(
@CustomerID nvarchar(50),
@JobOrderID nvarchar(50)
)

AS
SELECT Invoice.JobOrderID, ProductOrders.StyleNumber, ProductOrders.Sizes, ProductOrders.OrderedQuantity, ProductOrders.QuantityDelivered, ProductOrders.UnitCost,
ProductOrders.SubTotal, Customer.BusinessName, CustomerAddress.StreetNumber, CustomerAddress.City, CustomerAddress.Province, CustomerAddress.ZipCode,
Invoice.CustomerID
FROM Invoice INNER JOIN
ProductOrders ON Invoice.JobOrderID = ProductOrders.JobOrderID INNER JOIN
Customer ON Invoice.CustomerID = Customer.CustomerID INNER JOIN
CustomerAddress ON Invoice.CustomerID = CustomerAddress.CustomerID
WHERE (Invoice.JobOrderID = @JobOrderID) AND (Invoice.CustomerID = @CustomerID) AND (CustomerAddress.Type = N'Shipping')
RETURN
Posted

1 solution

 
Share this answer
 
Comments
DLSU-D Student 11-Mar-14 11:37am    
ALVIN CEDO. KAYA MO YAN BRO.
Manoj Kumar Choubey 11-Mar-14 11:47am    
??

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900