I am looking to see if I can update a field, based on conditions from 2 tables.
tblCustomers [CustomerID], [Status]
tblBid [BidID], [CustomerID], [BidDate]
I need to run a DateDiff to find out if between Today and BidDate has been
>30 And their Status = "Bid/Estimate"
If that holds true, I want to change the Status to "Follow-Up".
I'm not sure how to run code or even begin putting it together.
I need some advice!
Daniel - 28 Nov 2006 22:21 GMT
Is this to be done in a form as a user enters data or are you looking to do
bulk processing of all the entries in your table?
Daniel
> I am looking to see if I can update a field, based on conditions from 2 tables.
> tblCustomers [CustomerID], [Status]
[quoted text clipped - 6 lines]
> I'm not sure how to run code or even begin putting it together.
> I need some advice!
Jeffshex - 28 Nov 2006 22:25 GMT
Bulk Processing.
I just did a query that has the customer ID, their BidDate, Status, and a
calculated field between Date() and BidDate. I suppose I could run some code
off of that to update where Status = "Bid/Estimate" and DaysPassed > 30.
Thoughts?
John Spencer - 29 Nov 2006 12:52 GMT
So, what do you want the status to be if a customer has multiple bids? The
SQL below doesn't care if you have mutliple bids
UPDATE tblCustomers INNER JOIN tblBid
ON tblCustomers.CustomerID = tblBid.CustomerID
SET TblCustomers.Status ="Follow-up"
WHERE tblBid.BidDate <= Date()-30 and
tblCustomers.Status = "Bid/Estimate"
If you already have a query that shows which records you want to update then
all you need to do is open it in design view and select Query: Update Query
from the menu. Then in the update to enter "Follow-Up" and then select
Query: Run from the menu. You can save the changed query to another name if
you desire.
>I am looking to see if I can update a field, based on conditions from 2
>tables.
[quoted text clipped - 7 lines]
> I'm not sure how to run code or even begin putting it together.
> I need some advice!