How to add a calculated field to a Microsoft Access query that equals the minimum value of the previous column field
1
vote
0
answers
88
views
I have a simple query on a very complex query that reads:
lang-sql
SELECT Query1.Rdate, Query1.Rank, Query1.Score
FROM Query1;
It returns:
| RDate | Rank | Score |
| ----- | ---- | ----- |
|2/1/2022|5|0.9|
|2/1/2022|3|0.6|
|2/1/2022|1|0.3|
|2/1/2022|2|0.8|
|2/1/2022|4|0.2|
I need a second query that uses this query to return:
| RDate | Rank | Score | MinScore |
| ----- | ---- | ----- | -------- |
|2/1/2022|5|0.9|0.2|
|2/1/2022|3|0.6|0.2|
|2/1/2022|1|0.3|0.2|
|2/1/2022|2|0.8|0.2|
|2/1/2022|4|0.2|0.2|
where the new column of 0.2 represents the Minimum value of the previous column.
I know I can write a query that will return a single column of the value 0.2 and then ANOTHER QUERY to combine that column with my original query. But I have over 200 original queries. I would then end up with over 600 queries. I don't want to go down that path if I can avoid it.
Asked by HBHAYWOOD
(11 rep)
Mar 29, 2023, 11:23 PM
Last activity: Oct 16, 2023, 09:35 PM
Last activity: Oct 16, 2023, 09:35 PM