Selasa, 19 Februari 2019

[MS_AccessPros] Union Query load very slowly.

 

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)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Tidak ada komentar:

Posting Komentar