- Local time
- Today, 03:37
- Joined
- Sep 28, 2010
- Messages
- 83
Morning folks,
Just wondered if anyone had any thoughts on how I can get this query to be accurate! The LAST function doesn't appear to be finding the last entry every time, in fact having just refreshed the query a number of times it has presented a different priority value each time!
I've pasted the query below if anyone is interested in trying to help me work this out..
SELECT DISTINCT dbo_ReportData.docket, dbo_ReportData.site_search, dbo_ReportData.Name, Last(dbo_ReportData.Priority) AS LastOfPriority, Min(dbo_ReportData.[Job No]) AS [MinOfJob No], Max(dbo_ReportData.[Job No]) AS [MaxOfJob No]
FROM dbo_ReportData
WHERE (((dbo_ReportData.[log num]) In (1,2,3,5,6,12,24,36,99,8,14)) AND ((dbo_ReportData.docket) In (SELECT DISTINCT dbo_ReportData.Docket
FROM dbo_ReportData
WHERE (((dbo_ReportData.[Completion Date])>=Date()-31))
GROUP BY dbo_ReportData.Docket
))
GROUP BY dbo_ReportData.docket, dbo_ReportData.site_search, dbo_ReportData.Name;
Thanks in advance..
Just wondered if anyone had any thoughts on how I can get this query to be accurate! The LAST function doesn't appear to be finding the last entry every time, in fact having just refreshed the query a number of times it has presented a different priority value each time!
I've pasted the query below if anyone is interested in trying to help me work this out..
SELECT DISTINCT dbo_ReportData.docket, dbo_ReportData.site_search, dbo_ReportData.Name, Last(dbo_ReportData.Priority) AS LastOfPriority, Min(dbo_ReportData.[Job No]) AS [MinOfJob No], Max(dbo_ReportData.[Job No]) AS [MaxOfJob No]
FROM dbo_ReportData
WHERE (((dbo_ReportData.[log num]) In (1,2,3,5,6,12,24,36,99,8,14)) AND ((dbo_ReportData.docket) In (SELECT DISTINCT dbo_ReportData.Docket
FROM dbo_ReportData
WHERE (((dbo_ReportData.[Completion Date])>=Date()-31))
GROUP BY dbo_ReportData.Docket

GROUP BY dbo_ReportData.docket, dbo_ReportData.site_search, dbo_ReportData.Name;
Thanks in advance..