Forum Discussion
#Error in Query (nulls?)
- Sep 14, 2023
Hi Tony,
> the format is short text for both of those fields.
Ok, then I misunderstood your description. I thought you were getting the error only for some records. With this information it is clear that you should get the error for every record because the syntax for text is different than for numbers. You have to put the text parameter in quotation marks:
WDDateGetError: DLookUp("MaxOfWithdrawalDate","qryWDDate","Reference = '" & [Invoice No] & "'"
[edited after XPS35 spotted the wrong column/field name]
Servus
Karl
****************
Access Forever
Access News
Access DevCon
Access-Entwickler-Konferenz AEK
Hi Karl, thank you for the response. I thought for certain that would be the solution but unfortunately, I still get the =#error. I confirm I do have nulls on [Invoice No] and [Reference].
the format is short text for both of those fields.
let me know what is the next step. thank you!
If it makes a difference, the query is as follows: (its a grouped query and a max on [WithdrawalDate])
SELECT tblPmtProposalALL.ID2, tblPmtProposalALL.DDNo, tblPmtProposalALL.Reference, tblPmtProposalALL.Amount, Max(tblDraws_CAWC.WithdrawalDate) AS MaxOfWithdrawalDate
FROM (tblDraws INNER JOIN (tblCompanies INNER JOIN tblPmtProposalALL ON tblCompanies.CoID = tblPmtProposalALL.ID2) ON tblDraws.ID = tblPmtProposalALL.DrawIDfk) INNER JOIN tblDraws_CAWC ON tblDraws.ID = tblDraws_CAWC.IDDraws
GROUP BY tblPmtProposalALL.ID2, tblPmtProposalALL.DDNo, tblPmtProposalALL.Reference, tblPmtProposalALL.Amount
ORDER BY tblPmtProposalALL.DDNo;