update subquery

S

supicek

Problem description:

TABLE: tbCustomers with fields: cuID, cuStatus (customer, prospect, key
accnt,etc)
QUERY: qLastSales with fields: cuID, lastInvoiceDate, newStatus (Customer,
Customer1, Customer2)

the query goes through sales table and lookup the last invoice date, based
on this date it allocates newStatus for each customer. The statuses are:
Customer - last sales not older then 1 year
Customer1 - last sales older then 1 year
Customer2 - last sales older then 2 years

I would like to create an UPDATE query which would amend the
tbCustomers.cuStatus field with value from qLastSales.newStatus. I think I
would have to use a subquery, but cannot figure it out.

thanks for your help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top