Query 2nd column of a table (field expression) - Better explained

M

Mike D.

Jeff - thanks for your reply, but I feel as though I need
to explain myself more.


I have a field in a table that has 2 columns. I want to
run a query to search in just the 2nd column.

An example of the USER field in my table -
John | 1st shift
Mike | 2nd shift
Lisa | 1st shift

I want to return results that are just "1st shift"

My thoughts are that I need some type of expression in
the Field for the query. Maybe something like
USER.column2 as the Field ??? with "1st shift" as
criteria.
 
R

Roxie Aho

To solve your immediate problem, try a query in which you
build a second field which is:
Expr1: Right$([User],Len([User])-InStr(1,[User],"|")-1)
Put your criteria in the Expr1 field, which you will
rename to suit your needs.

For the long term, look at your database design. You have
three items in one field (first, last and shift). These
belong in at least 3 fields with first and last in an
employee table and Shift in a second table. Read about
Normalization of a database.

Roxie Aho
 

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