Hej,
Table 1: Customer primary key customer Id, other fields: CustomerName and SendInvitation (Yes/no)
Table 2: Activities primary key activityId, foreign key customerId. Another field: Name, description
I need to create query that would create new activity for each customer that has SentInvitation = yes
To make it mo clear:
Lets say 5 out of 2 customers has SentInvitation field value equal to yes
CustomerId, CustomerName, SendInvitation
1, Tom, yes
2, john, no
3, Petter, yes
4, Lisa, no
5, Alex, no
What i want is after running a query that only requires me to enter activity description. After running it my Activities table should have 2 new records that should look like that:
ActivityID, customerId, CustomerName, Description
autonumber, 1, Tom, "Come visit me"
autonumber, 3, Petter, "Come visit me"
Or more in other words
For each Customer that has sendinvitation = yes Do
Create new activities record with values:
ActivityID - auto-generated , customerId = customers.CustomerId , CustomerName = customers.CustomerName , Description - user provided