Dear All,
I have a union query behind a unbound subform as below. It takes about
0.5 minutes to load. Is that any way to improve the loading speed?
Thanks in advance.
SELECT
ID,LetterType,TransactionID,TransactionType,OfficeLocation,CostType,Amount,RecordDate,IIf([Checked]=True,"已审核","")
As
CheckAlready,GroupAndRemark,AccountID,ActualTransactionDate,Month(ActualTransactionDate)
As ActualMonth,ELookup("AccountName","tblAccount","AccountID=" &
Nz([AccountID],0)) As Account,Year(ActualTransactionDate) As
ActualYear,FinalAmount FROM qryaTransaction
UNION SELECT
ID,LetterType,ManagerialCostID,TransactionType,OfficeLocation,ManagerialCostType,Amount,RecordDate,IIf([Checked]=True,"已审核","")
As
CheckAlready,Remark,AccountID,ActualTransactionDate,Month(ActualTransactionDate)
As ActualMonth,ELookup("AccountName","tblAccount","AccountID=" &
Nz([AccountID],0)) As Account,Year(ActualTransactionDate) As
ActualYear,FinalAmount FROM qrybManagerialCost
UNION SELECT
ID,LetterType,PromotionCostID,TransactionType,OfficeLocation,PromotionCostType,Amount,RecordedDate,IIf([Checked]=True,"已审核","")
As
CheckAlready,Remark,AccountID,ActualTransactionDate,Month(ActualTransactionDate)
As ActualMonth,ELookup("AccountName","tblAccount","AccountID=" &
Nz([AccountID],0)) As Account,Year(ActualTransactionDate) As
ActualYear,FinalAmount FROM qrycPromotionCost
UNION SELECT
ID,LetterType,OtherIncomeID,TransactionType,OfficeLocation,OtherIncomeType,Amount,RecordDate,IIf([Checked]=True,"已审核","")
As
CheckAlready,Remark,AccountID,ActualOtherIncomeDate,Month(ActualOtherIncomeDate)
As ActualMonth,ELookup("AccountName","tblAccount","AccountID=" &
Nz([AccountID],0)) As Account,Year(ActualOtherIncomeDate) As
ActualYear,FinalAmount FROM qrydOtherIncome
UNION SELECT
ID,LetterType,OtherCostID,TransactionType,OfficeLocation,OtherCostType,Amount,RecordDate,IIf([Checked]=True,"已审核","")
As
CheckAlready,Remark,AccountID,ActualOtherCostDate,Month(ActualOtherCostDate)
As ActualMonth,ELookup("AccountName","tblAccount","AccountID=" &
Nz([AccountID],0)) As Account,Year(ActualOtherCostDate) As
ActualYear,FinalAmount FROM qryeOtherCost
ORDER BY 12, 11;
Best Regards,
Kevin
Posted by: Kevin <qingqinga@yahoo.com>
Reply via web post | • | Reply to sender | • | Reply to group | • | Start a New Topic | • | Messages in this topic (1) |
Tidak ada komentar:
Posting Komentar