Is it possible to use the result from a calculation in a query as data for a field in the table the query is based on?
Basically, I have an event that has a start date and an end date. The table stores individual events and the query only shows those events that have a start date but nio end date.
Also, each event can restart later with a new start date and end date.
I want to use the dates to calculate the number of days duration for the event's instance and store that in the table for later use - each event is allowed only a certain number of days.
Then, I'll need to add up the number of days for each instance of an event, to see if it has reached the maximum allowed.
So, like this;
Table Fields:
eventID, eventtype, startdate, enddate, numdays
As soon as I enter an end date for an event, I want it to calculate the number of days since the start and put that in the numdays field.
Then, I'll need to add up all the numdays for each eventtype.
The part I'm really having trouble with, though, is just the part to do a calculation and put the answer in the table that the query is based on.
In the event builder I tried [numdays] = [enddate] - [startdate], but it always drops the numdays part, leaving me with = [enddate] - [startdate].
Any ideas?
Basically, I have an event that has a start date and an end date. The table stores individual events and the query only shows those events that have a start date but nio end date.
Also, each event can restart later with a new start date and end date.
I want to use the dates to calculate the number of days duration for the event's instance and store that in the table for later use - each event is allowed only a certain number of days.
Then, I'll need to add up the number of days for each instance of an event, to see if it has reached the maximum allowed.
So, like this;
Table Fields:
eventID, eventtype, startdate, enddate, numdays
As soon as I enter an end date for an event, I want it to calculate the number of days since the start and put that in the numdays field.
Then, I'll need to add up all the numdays for each eventtype.
The part I'm really having trouble with, though, is just the part to do a calculation and put the answer in the table that the query is based on.
In the event builder I tried [numdays] = [enddate] - [startdate], but it always drops the numdays part, leaving me with = [enddate] - [startdate].
Any ideas?