|
Question : Automatic Update Query
|
|
I got a request asking if the MS Access database could automatically update the customer's status changing from "New" to "Established" if there was contacts with the customer for more than one month.
I believe that an automatic update would be doable by just adding it in the VB script for the On Close event on the Switchboard form.
However, I'm not sure how I can come up with the query. The query should involve two tables. Table 1 (C_Contacts) has the status field and Table 2 has the CallDate field.
This query will pull all records showing customer ID, customer status and the calldate SELECT C_Contacts.Consumer_ID, C_Contacts.C_Status, C_Calls.C_CallDate FROM C_Contacts INNER JOIN C_Calls ON C_Contacts.Consumer_ID = C_Calls.ConsumerID;
How can I come up with a query to update a record changing the status from New to Established if they have C_CallDate that spans over one month?
|
|
Answer : Automatic Update Query
|
|
something like this
update c_contacts,c_calls set c_contacts.status="established" where c_contacts.status="new" and c_contacts.consumer_id=c_calls.consumerId and c_calls.c_calldate <=date()-30
|
|
|
|