Click here to Skip to main content
15,850,685 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I got an Error Creating view in SQl.The Below Mentioned is my query..

What I have tried:

SQL
CREATE  VIEW vwbuyerinvoicebankcharges AS 
SELECT a.SID AS InvoiceSid,
ISNULL((SELECT ROUND(SUM((ROUND(((b.Amount / c.Amount) * c.BankCharge),5) * c.ExchangeRate)),2)
FROM tblbuyerinvoiceadvancedetail B 
JOIN vwadvancemasterwithexrate C 
ON C.AdvanceSid = b.AdvanceSid WHERE b.MasterSid = a.SID 
ISNULL(SELECT ROUND(b1.NegoBankChargeAmt * b1.ExchangeRate,2) 
AS Round(B1.Negobankchargeamt*B1.ExchangeRate,2)
FROM vwbanknegotiationwithexrate B1 
WHERE b1.InvoiceSid = a.SID AS NegoBankCharge)
FROM tblbuyerinvoicemaster a GROUP BY a.SID
Posted
Updated 3-Sep-18 1:35am
v3
Comments
Patrice T 3-Sep-18 6:34am    
"I got an Error Creating view in SQl."
Simple: apply "a Correction".
Unless you want to tell what is the error message.

1 solution

It'd difficult to say exactly where you are wrong, but for starters you brackets don;t match up - you have more "(" than ")". There are 11 "(" and only 9 ")"

I'd suggest that you start by indenting that so you can see what you were expecting to type, and then match up brackets to where they should be. I'm not entirely sure which open brackets need their close, or where they should go...
 
Share this answer
 

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