John,
My Fields are; Last Name, Department, Supervisor, and Date Entered Training.
Would the string you provide me be entered in one of these fields? And/or in
the Total row that you explained below?
Thanks for your help and patience.
Sorry! I must have been really sleepy when I posted that SQL. It's
wrong on several counts.
SELECT <other fields>, DateDiff("m", Min([Date Entered Training]),
Max([Date Entered Training])) AS MonthsInTraining
WHERE MonthsInTraining > 12;
Create a new Query based on your table. Change it to a Totals query by
clicking the Greek Sigma icon. Select the name fields that you want to
see (any or all of the three), but don't select the [Date Entered
Training] field. In a vacant Field cell type
MonthsEnteredTraining: DateDiff("m", Min([Date Entered Training]),
Max([Date Entered Training]))
(all on one line, Agent is word-wrapping the message). On the Criteria
line under this field put
to select only those employees who have been in training for over 12
months.
Queries are usually built in the query grid, but that's actually just
a user-friendly (more or less) tool for constructing SQL statements.
It's very hard to post a query grid readably in a message; but the
apparently cryptic text you get when you use View... SQL or click the
SQL icon on the leftmost dropdown in the query design toolbar is the
actual definition of the Query, and is the preferred manner of viewing
queries on the newsgroups.
John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps