Curious Error

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
 
G

GVaught

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top