By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,462 Members | 2,360 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,462 IT Pros & Developers. It's quick & easy.

problem with sql

P: n/a
Hello to everyone,

In my own database, I linked customers table with orders table using
one-to-many relation. I need to check status of last order for each
customer and then set customer's status. I made a query using LAST and
GROUP BY to select last order for each customer and I wanted to use it
in UPDATE query, but it seems to be impossible. Is here anybody who
knows how to solve this problem? (I work with MS Access).

Adam

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Last picks the value from the last record in the grouping, which because the
records are unordered if you don't specify, may not be the most recent date.
It does not, repeat NOT, select the last record but only that one column's
value from the last record.

To get the most recent value, on the pertinent date field, choose OrderBy,
Ascending, and use Last on all the Columns for which you want data from the
most recent record.

"Ada¶" <ad***@qwe.pl> wrote in message
news:Oj********************@news.chello.at...
Hello to everyone,

In my own database, I linked customers table with orders table using
one-to-many relation. I need to check status of last order for each
customer and then set customer's status. I made a query using LAST and
GROUP BY to select last order for each customer and I wanted to use it
in UPDATE query, but it seems to be impossible. Is here anybody who
knows how to solve this problem? (I work with MS Access).

Adam

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.