Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. SELECT IIf(IsNull([Production]![Product_Title]) Or [Production]![Product_Title] Like "Process*","Not Started","Started")
  2. AS Status, Max(Travel.Date) AS MaxOfDate, Person.ID, Person.LastName, Person.FirstName, Person.MiddleName,
  3. Person.Date, Person.Place, Person.Type, Production.Product_Title, Production.Publish_Date
  4.  
  5. FROM (Person LEFT JOIN Production ON Person.ID = Production.ID) INNER JOIN Travel ON Person.ID = Travel.ID
  6.  
  7. GROUP BY IIf(IsNull([Production]![Product_Title]) Or [Production]![Product_Title] Like "Process*","Not Started",
  8. "Started"), Person.ID, Person.LastName, Person.FirstName, Person.MiddleName, Person.Date, Person.Place,
  9. Person.Type, Production.Product_Title, Production.Publish_Date
  10.  
  11. HAVING (((IIf(IsNull(Production!Product_Title) Or Production!Product_Title Like "Process*","Not Started",
  12. "Started"))="Not Started") And ((Person.Type) Is Not Null))
  13.  
  14. ORDER BY IIf(IsNull([Production]![Product_Title]) Or [Production]![Product_Title] Like "Process*","Not Started",
  15. "Started"), Max(Travel.Date), Person.Type;
  16.  
  17. SELECT p."Product_Title" as Status, max(t."Date") as MaxOfDate, i."ID", i."LastName", i."FirstName",
  18. i."MiddleName", i."Date", i."Place", i."Type", p."Product_Title", p."Publish_Date"
  19.  
  20. FROM (x."Person" i left join x."Production" p on i."ID" = p."ID") inner join x."Travel" t on i."ID" = t."ID"
  21.  
  22. WHERE p."Product_Title" LIKE '%Process%' OR p."Product_Title" LIKE '%Not Started%' OR p."Product_Title" LIKE '%Started%'
  23. OR p."Product_Title" isnull
  24.  
  25. GROUP BY p."Product_Title" LIKE '%Process%' OR p."Product_Title" LIKE '%Not Started%' OR p."Product_Title" LIKE '%Started%'
  26. OR p."Product_Title" isnull, i."FIN", i."LastName", i."FirstName", i."MiddleName", i."Date", i."Place",
  27. i."Type", p."Product_Title", p."Publish_Date"
  28.  
  29. HAVING CASE WHEN (p."Product_Title" LIKE '%Process%' OR p."Product_Title" LIKE '%Not Started%' OR p."Product_Title" LIKE '%Started%'
  30. OR p."Product_Title" isnull) THEN "Not Started" ELSE i."Type" IS NOT NULL END
  31.  
  32. ORDER BY p."Product_Title" LIKE '%Process%' OR p."Product_Title" LIKE '%Not Started%' OR p."Product_Title" LIKE '%Started%'
  33. OR p."Product_Title" isnull;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement