Returnin the latest record

  • Thread starter Thread starter Phil F
  • Start date Start date
P

Phil F

I have a query question. I have two tables, table 1 has
an ID number and user name, the transaction table has ID
number, transaction code (text) and date. The transaction
table has many entries for each ID number.

I would like to write a query that returns the ID & name
from table 1 but does not return an ID if anywhere in the
transaction table(transaction code field) there's a
code "XD". Any direction wold be appreciated.

Phil F
 
You would need a query with the two tables and with an outter join to the second table. It would need to be a totals query with a Group By for the ID number and Name. Under the field for transaction code have it a Where for the totals and put Like "*"&"XD"&"*"
in the criteria line. If at all possible, try not to have the "XD" hard coded in your query unless it will Always be that way. I usually refer to a field or unbound box for the parameter so your criterial would be
Like "*" & Forms![frmInput]![CriteriaField]&"*"

Hope this helps.
 
Back
Top