Not sure why you've posted to this old thread.
Unless you've entered these characters, it's a sign of data corruption.
If it's only a couple of records, delete them, compact and recreate the records.
If it's a lot of records, it will be more tricky.
If this answer isn't sufficient, please start a new thread
This is an old thread but I have the same problem as OP and am getting errors when using the solutions presented here. I am attempting to filter an ID by the most recent date while including additional information specific to the ID.
My
Example table:
ID Date Frequency
1 1/1/2020 12
1 2/3/2018 48
2 4/23/2018 48
2 7/24/2021 48
3 8/9/2017 12
3 4/23/2018 24
I am trying to return the ID's information for the most recent date:
ID Date Frequency
1 1/1/2020 12
2 7/24/2021 48
3 4/23/2018 24
I have followed the instructions provided by pbaldy but my query is only returning the IDs associated with a single date that is prompted by access upon executing the query.
my two tables are [Active Table] and [Info].
my first query [Active] looks like:
SELECT [Active Table].[ID], Max([Info].[Date]) AS [MaxOfDate1]
FROM [Active Table] INNER JOIN [Info] ON [Active Table].[ID] = [Info].[ID]
GROUP BY [Active Table].[ID];
the second query looks like:
SELECT [Active].[ID], [Info].[Frequency]
FROM [Info] INNER JOIN [Active]
ON ([Info].[ID] = [Active].[ID])
AND ([Info].[Date] = [Active].[Date])
When it's executed the prompt is "enter parameter value" for [Active].[Date] so that it only returns information for IDs with dates equal to the one inputted.
SELECT
E.ID,
E.Date,
E.Frequency
FROM
ExampleTable AS E
INNER JOIN
(
SELECT
ID,
MAX(Date) AS MaxDate
FROM
ExampleTable
GROUP BY
ID
) AS SQ
ON E.ID = SQ.ID
AND
E.Date = SQ.MaxDate
SELECT
E.ID,
E.Date,
E.Frequency
FROM
ExampleTable AS E
INNER JOIN
(
SELECT
ID,
MAX(Date) AS MaxDate
FROM
ExampleTable
GROUP BY
ID
) AS SQ
ON E.ID = SQ.ID
AND
E.Date = SQ.MaxDate
Hah, not sure how that snuck in. Correcting that fixed the prompt that I previously mentioned. I'm still getting some duplicate line items along with some blanks, but I should be able to filter those out with Is Not Null and by removing duplicates. Thanks for the help.