G
gobis
Hello everyone,
Briefly stated, I have a table structured like:
VariableName (string) Value (double) Date (date)
Variable names can be repeated (don't worry, in the actual table I
have index numbers that call up the variable names from another
table), so this table contains a limited number of variables' values
that can change independently.
I am using two queries that work together to give the values
corresponding to the latest dates. One query groups by VariableName's
and uses Max(Date) aggregate function to get the latest date, then the
second query joins the first query with the table once again to find
the values corresponding to the latest dates found in the first query.
If all these have made any sense, can anyone tell me a way to
accomplish the same thing in a single query? Joining this table with a
second copy of itself did not help. Not a big deal, but I thought
there might be a simple solution.
Thanks for anyone's time for even reading this.
Take care,
Hurol
Briefly stated, I have a table structured like:
VariableName (string) Value (double) Date (date)
Variable names can be repeated (don't worry, in the actual table I
have index numbers that call up the variable names from another
table), so this table contains a limited number of variables' values
that can change independently.
I am using two queries that work together to give the values
corresponding to the latest dates. One query groups by VariableName's
and uses Max(Date) aggregate function to get the latest date, then the
second query joins the first query with the table once again to find
the values corresponding to the latest dates found in the first query.
If all these have made any sense, can anyone tell me a way to
accomplish the same thing in a single query? Joining this table with a
second copy of itself did not help. Not a big deal, but I thought
there might be a simple solution.
Thanks for anyone's time for even reading this.
Take care,
Hurol