I Tried to write a VIEW In Sql Server with UNION Operation
Like this:
"SELECT TblRec.Rc_CodeCliBranch,TblRec.Rc_CodeClient, TblRec.Rc_CodeBranch,TblRec.Rc_CodeRecipt, TblBillRec.BR_Amount AS TotalPay, TblRec.Rc_TotalAmount AS TotalRec
FROM TblBillRec INNER JOIN TblRec ON TblBillRec.BR_CodeRecipt=TblRec.Rc_CodeRecipt AND TblBillRec.BR_CodeReciptBranch=TblRec.Rc_CodeBranch
UNION
SELECT TblRec.Rc_CodeCliBranch,TblRec.Rc_CodeClient, TblRec.Rc_CodeBranch,TblRec.Rc_CodeRecipt,TblRecNegBill.RNB_Amount AS TotalPay, TblRec.Rc_TotalAmount AS TotalRec
FROM TblRecNegBill INNER JOIN TblRec ON TblRecNegBill.RNB_CodeRecipt=TblRec.Rc_CodeRecipt AND TblRec.Rc_CodeBranch=TblRecNegBill.RNB_CodeReciptBranch "
but I got a massage like:
"Query Desiner doas not support UNION Sql Construct"
my question Is how can I Create a UNION Query in Sql Server and save it?
Like this:
"SELECT TblRec.Rc_CodeCliBranch,TblRec.Rc_CodeClient, TblRec.Rc_CodeBranch,TblRec.Rc_CodeRecipt, TblBillRec.BR_Amount AS TotalPay, TblRec.Rc_TotalAmount AS TotalRec
FROM TblBillRec INNER JOIN TblRec ON TblBillRec.BR_CodeRecipt=TblRec.Rc_CodeRecipt AND TblBillRec.BR_CodeReciptBranch=TblRec.Rc_CodeBranch
UNION
SELECT TblRec.Rc_CodeCliBranch,TblRec.Rc_CodeClient, TblRec.Rc_CodeBranch,TblRec.Rc_CodeRecipt,TblRecNegBill.RNB_Amount AS TotalPay, TblRec.Rc_TotalAmount AS TotalRec
FROM TblRecNegBill INNER JOIN TblRec ON TblRecNegBill.RNB_CodeRecipt=TblRec.Rc_CodeRecipt AND TblRec.Rc_CodeBranch=TblRecNegBill.RNB_CodeReciptBranch "
but I got a massage like:
"Query Desiner doas not support UNION Sql Construct"
my question Is how can I Create a UNION Query in Sql Server and save it?