Select Distinct

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 2 tables that I'm trying to query to get an updated result. I don't
want to have duplicate job #'s yet I want the most current job #'s to join
with all the other info listed in MASTER_JCM_JOB_1 table. Do I need to just
do a select distinct on the job#'s and if so, how exactly?

How do I do this correctly? Thanks! Here is my SQL so far-

--------------------------------------------------------------------------------

SELECT DISTINCT MASTER_JCM_JOB_1.Job, MASTER_JCM_JOB_1.Description,
MASTER_JCM_JOB_1.Address_1, MASTER_JCM_JOB_1.Address_2,
MASTER_JCM_JOB_1.City, MASTER_JCM_JOB_1.State, MASTER_JCM_JOB_1.ZIP_Code,
MASTER_JCM_JOB_1.Site_Phone, MASTER_JCM_JOB_1.Fax_Phone,
MASTER_JCM_JOB_1.Supt_Pager, MASTER_JCM_JOB_1.Project_Manager,
MASTER_JCM_JOB_1.Superintendent, MASTER_JCM_JOB_1.StatusFROM MASTER_JCM_JOB_1
LEFT JOIN Current_Supers_Jobs ON MASTER_JCM_JOB_1.Job =
Current_Supers_Jobs.JobWHERE (((MASTER_JCM_JOB_1.Status)<>"Closed"))ORDER BY
MASTER_JCM_JOB_1.Job;
 
Hi,


Have all the required data, possibly with duplicated entries, then applied
one of the four technique in http://www.mvps.org/access/queries/qry0020.htm
to pump only the entry that correspond to the "latest" entry (such as
answering "who is the last to have borrow each book", in a library, from a
list of all books-borrowing transactions).


Hoping it may help,
Vanderghast, Access MVP
 

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