Dear All,
Here is the union query:
SELECT All
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,Checked FROM qryaTransaction
UNION All 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,Checked FROM qrybManagerialCost
UNION All 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,Checked FROM qrycPromotionCost
UNION All 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,Checked FROM qrydOtherIncome
UNION ALL 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,Checked FROM qryeOtherCost
WHERE ((ActualMonth)=11 AND (ActualYear)=2018);
Best Regards,
Kevin
Dear All,
I made a mistake, it's union query, not "joned query".
Best Regards,
Kevin
On 03-Apr-2019 6:52 PM, Kevin qingqinga@yahoo.com
[MS_Access_Professionals] wrote:
> Dear All,
>
> In a joined query, I put the condition as below:
>
> WHERE ((11)=1 AND (15)=Forms!frmAllReceipt!TransactionYear AND
> (13)=Forms!frmAllReceipt!TransactionMonth);
>
> It does work well with 15 and 13, but 11 doesn't screen out the expected
> result. behind the 11 is AcountID.
>
> Please help. Thanks in advance.
>
> 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 (3) |
Tidak ada komentar:
Posting Komentar