Two Tables with the same field name

  • Thread starter Thread starter tc
  • Start date Start date
T

tc

hi, i have two tables with different names; however, i have a field in
both these tables which have the same name. i need to calculate the
difference between the two fields. however, when i try to create a
query, i get a error message saying that there are multiple fields
with the same name. how do i overcome this problem?
 
You need to add the table name to the calculation

Don't just put [YourField]+[YourField]

but use this
[YourTable1]![FieldName]+[YourTable2]![YourField]

So your are adding
[YourTable1] and [YourTable2]

SELECT [YourTable1]![FieldName]+[YourTable2]![YourField] AS TheSum
FROM YourTable1, YourTable2;


HTH
 

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

Back
Top