Curious Error

  • Thread starter Thread starter Kevin Sprinkel
  • Start date Start date
K

Kevin Sprinkel

SELECT M.JobNumber, M.EstimateNumber, M.Phase, M.Amount,
M.SForQty, M.Unit, M.Note, M.PrintUnits
FROM tblEstimateData AS M
WHERE (((M.EstimateNumber)<>(SELECT Max(EstimateNumber)
FROM tblEstimateData As T
WHERE T.JobNumber = M.JobNumber)));

is the underlying query for a report. In attempting to
concatenate [Unit] and [Note], I generated an error with
the following control source: = Nz([Unit])& Nz([Note]).
Trying to isolate the error, I tried the following control
source expressions, with these results:

Control Source Result
-------------- -------------------------------
=Nz([Unit]) Correct value of [Unit] field
=Nz([Phase]) Correct value of [Phase] field
=Nz([SForQty]) Correct value of [SForQty] field
=Nz([Note]) ERROR
=Nz([M.Note]) Correct value of [Note] field
=Nz([Unit])& Nz([M.Note]) Correct value of concatenation

[Note] alone required the tablename reference, even though
there is no other [Note] field from another table.

Does anyone know why? Thanks.

Kevin Sprinkel
Becker & Frondorf
 
The reason is because you aliased the [Note] field in your Select statement.
Also since you are connecting tblEstimateData to itself, you aliased the
second connection as T. The query statement needs to be quantified to which
alias you are using: M.Note or T.Note.

Hope that helps
 
Back
Top