HiI am sure this is a lame question, but I'd be very grateful for any help.I have two SQL queries that each work separately. But I'd like to link them together, and I simply can't get them to work. I'm sure it can be done, but how...?The first query pulls a table of records from a set of tables. Here it is:SELECT Clients.clientname AS Client, Projects.projectname AS Project, Projects.dbestimatedhours AS "Win Probability", Projects.dbamountquoted AS "Est. Total Value", ROUND(Projects.dbamountquoted*Projects.dbestimatedhours,0) AS "Pipeline Value", Projects.startdate AS "Est. Start", substr(trim(replace(Categories.categoryinfo,'OINSDPRPR8N3OSIFVN',' ')),0,11) AS Who, CASE WHEN Projects.status = 'PS-1111' THEN 'Prospect' WHEN Projects.status = 'PS-1112' THEN 'Proposal' END AS StatusFROM Projects INNER JOIN Clients ON Projects.AttachedToID = Clients.SID INNER JOIN Categories ON Projects.category = Categories.SIDWHERE (Projects.status = "PS-1111" or Projects.status = "PS-1112")ORDER BY Projects.status DESC, Who ASC, "Est. Start" ASC
The Second query pulls the most recent log statements for all projects in the databaseSELECT MAX(NETdatemodifiedstring) AS LogDate, CLogs.Subject||' // '||CLogs.Content AS CommentFROM CLogsGROUP BY CLogs.LinksORDER BY CLogs.NETdatemodifiedstring ASC
What I am trying to do (and so far failing) is to combine these two queries so I end up with a single table that has project information for the subset of projects chosen by first query, and the most recent comment for the project (if there is one, many don't have one).Can anyone help?Thanks a lot in advance.