Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 i can not select by wehere and group by in select

Author  Topic 

niyaz4872
Starting Member

41 Posts

Posted - 2012-08-01 : 04:23:49
SELECT (SELECT sum(RecordMoney) FROM vw_PayS_PersonInvoice WHERE (Company_ID='04') AND (Anbar_ID='13') AND (RecordType=7) AND (OperationDate < '13910101')) as test and group by SAL_FactorHdr.FactorHdr_ID )

FROM COM_Company INNER JOIN
SAL_FactorHdr ON COM_Company.COM_ID = SAL_FactorHdr.FactorHdr_Com_ID RIGHT OUTER JOIN
SAl_Customers ON SAL_FactorHdr.FactorHdr_Ctm_ID = SAl_Customers.Ctm_Id RIGHT OUTER JOIN
vw_PayS_PersonInvoice ON SAL_FactorHdr.FactorHdr_Ctm_ID = vw_PayS_PersonInvoice.Tafzili_ID
WHERE (SAL_FactorHdr.FactorHdr_Com_ID = '04')group by SAL_FactorHdr.FactorHdr_ID )

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-08-01 : 04:46:38
Do you really think we can help without helpful information?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -