Subquery in Access?? Is that possible?

  • Thread starter Thread starter Jason B
  • Start date Start date
J

Jason B

I have a query that pulls: groupName Where the effective
dates are current (orgin_dt, term_dt). Each group has
multiple rows due to group terminating then going back
into production. So I believe that calls for a subquery.
I was thinking it would be something like this:
SELECT groupName
FROM group
WHERE term_dt =
(SELETCT MAX term_dt
FROM group
WHERE ?)

Am I on the right track? How do you write that in Access
SQL?

Thanks for the help in advance.
 
Dear Jason:

I'm not sure just what you want. Do you simply want the names of all
group where there is at least one current effective date? And what is
the definition of what is a current effective date?

Can you write a simple query that returns the groupName for all rows
that are current? If so, then reduce that query to show only
groupName and add DISTINCT, as in:

SELECT DISTINCT groupName FROM group
WHERE term_dt < whatever means it is currnet >

Change "< whatever means it is current >" to something that determines
whethere a term_dt value is, well, current.

If you really need a subquery, I need to know the additional details
as I asked above.

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 

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

Similar Threads

Subquery group by 4
Subqueries 3
Subquery 3
Referring to fields in a subquery 1
SubQueries 14
Multiple-Column Subquery In FROM Clause 2
Subquery 6
Subquery issue 5

Back
Top