2015-05-27 162 views
0

有人可以請教我如何在Crystal Reports中實現以下SQL語句嗎?如何使用Crystal Reports實現此SQL語句?

select Debtor_Assessment_Facts.Assessment 
from Debtor_Assessment_Facts 
where Debtor_Assessment_Facts.Assessment_Facts_Key not in 
(
    select Debtor_Transaction_Facts.Assessment_Facts_Key 
    from Debtor_Transaction_Facts 
    inner join Debtor_Transaction_Types 
    on Debtor_Transaction_Facts.Transaction_type_Key = Debtor_Transaction_Types.Transaction_Type_Key 
    where Debtor_Transaction_Types.Transaction_Type_Code = 'RCPT' and Debtor_Transaction_Facts.Transaction_Date >= DATEADD(year,-6,GETDATE()) 
    group by Debtor_Transaction_Facts.Assessment_Facts_Key 
) 
and Debtor_Assessment_Facts.Balance <> 0 
order by Debtor_Assessment_Facts.Assessment 
+0

不同於論壇的網站,我們不使用「謝謝」 ,或者「任何幫助表示讚賞」,或簽名[so]。請參閱「[應該'嗨','謝謝',標語和致敬從帖子中刪除?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be -removed - 從 - 個)。 –

回答

0

打開水晶報表......做一個數據庫連接...不要添加命令並粘貼你的SQL語句那裏與報表設計進行