create Proc GetBillByBillNo
(
@BillNo int
)
as
begin
select SM.BillNo,SM.Quantity,SM.Price,SM.PriceB4VAT,
SM.PriceAfterVAT,SM.Discount,SM.DiscountDetails,SM.GrandTotal,
SM.CardType,SM.CardNumber,SM.IssuedBy,SM.BillDate,SM.CustomerMobileNo,
CONVERT(VARCHAR(10),SM.BillDate,103) 'InvoiceDate',sum(SM.GrandTotal),CM.CustomerName,CM.EmailAddress,
CM.CustomerAddress,PM.ProductName
from SalesMaster SM, CustomerMaster CM,ProductMaster PM
where
SM.ProductId = PM.ProductId
and
SM.CustomerId = CM.CustomerId
and
BillNo = @BillNo
group by SM.BillNo
end
It is giving me an Error
Column 'SalesMaster.Quantity' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Regards,
Raj.Trivedi
Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved