Help with SQL Query

Results 1 to 2 of 2

Thread: Help with SQL Query

  1. #1
    Join Date
    Dec 1969

    Default Help with SQL Query

    I have two table one for documents uploaded by clients and the other with client information. I am trying to display a 3 columned table with the following info; All Client Names their status and the date of their last upload. Here is what I worked out with obvious flaws in the logic here: <BR><BR>"select * from clients, documents where clients.client_id = documents.uploaded_for and date_uploaded = (select max(date_uploaded) from documents as date_uploaded) order by client_name" <BR><BR>Upon looking at this farther I realized that it was only going to return one record all the time. Duh! The record with the most recent date. Anway I need to return all the client names and the most recent date. Any hints or suggestions would be appreciated.<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Help with SQL Query

    SELECT C.Client_Name, C.Client_Status, MAX(D.Date_Uploaded) as LastUpload<BR>FROM Clients C INNER JOIN Documents D on C.Client_ID = D.Client_ID<BR>GROUP By C.Client_Name, C.Client_Status

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts