|
|
Up |
|
  |
Author: JessMJessM Date: Aug 8, 2008 21:36
I have a form that comments can be entered into and receive a time stamp. So
I end up with multiple comments per project number. I want to run a query
that only returns the newest comment for each project number.
Below is what I tried, but I get the following error message: The LEVEL
clause includes a word or argument that is misspelled or missing,
or the punctuation is incorrrect.
New Query:
SELECT Data_ProjectComments.Project_Number,
Data_ProjectComments.CurrentTime, Data_ProjectComments.CommentCode,
Data_ProjectComments.Comment
FROM Data_ProjectComments
WHERE (((Data_ProjectComments.CurrentTime)=(SELECT MAX(CurrentTime) FROM
Data_ProjectComments)));
Group By Data_ProjectComments.Project_Number
|
| |
|
| | 6 Comments |
|
  |
|
|
  |
Author: KARL DEWEYKARL DEWEY Date: Aug 8, 2008 22:14
> I get the following error message when I try it:
>
> You tried to execute a query that does not inlcude the specifed expression
> 'CurrentTime' as part of an aggregate function.
>
>
>
>
>
> "KARL...
|
| Show full article (2.06Kb) |
| no comments |
|
  |
Author: JessMJessM Date: Aug 8, 2008 22:19
It works but it only gives me the most recent project number comment overall,
it doesn't give me the most recent comment for each project number.
"KARL DEWEY" wrote:
|
| Show full article (2.35Kb) |
| no comments |
|
  |
Author: JessMJessM Date: Aug 8, 2008 22:39
I get the following error message when I try it:
You tried to execute a query that does not inlcude the specifed expression
'CurrentTime' as part of an aggregate function.
"KARL DEWEY" wrote:
|
| Show full article (1.47Kb) |
| no comments |
|
  |
Author: KARL DEWEYKARL DEWEY Date: Aug 9, 2008 00:09
> It works but it only gives me the most recent project number comment overall,
> it doesn't give me the most recent comment for each project number.
>
> "KARL DEWEY" wrote:
>
>> Try it this way -...
|
| Show full article (3.20Kb) |
| no comments |
|
  |
|
|
  |
Author: JessMJessM Date: Aug 11, 2008 15:08
Thanks - that worked!!
"KARL DEWEY" wrote:
> I do not know sub queries so I used two ---
> Data_ProjectComments_Latest ---
> SELECT Data_ProjectComments.Project_Number,
> Max(Data_ProjectComments.CurrentTime) AS MaxOfCurrentTime
> FROM Data_ProjectComments...
|
| Show full article (3.42Kb) |
| no comments |
|
|