Calculate date with condition

H

hoachen

A table with "Begining Date", "Ending Date" and many other fields. I am try
to determine is the item is still active or not active base on the condition.

An item to be active it has to be meet the criteries:
1. The "beginning date" cannot go pass 3 weeks into future date. If so, it
is consider inactive. If can, i would like to add a column stated "Active" or
"Inactive"

For example
Beginning date is 8/12/2009
Ending date is 12/03/2010

If the beginning date after 3 weeks (9/2/09) then this is consider INACTIVE
 
H

hoachen

Thank you Ken, it works perfectly. One more question, how about only display
the active one?

KenSheridan via AccessMonster.com said:
In a query put the following in the 'field' row of a blank column in design
view:

Status: IIf(DateAdd("ww",3,[Begining Date]) > Date(),"Active","Inactive")

Do not create a column in the table for this; compute it in a query as above.
That way it always reflects the status at the current date.

Ken Sheridan
Stafford, England
A table with "Begining Date", "Ending Date" and many other fields. I am try
to determine is the item is still active or not active base on the condition.

An item to be active it has to be meet the criteries:
1. The "beginning date" cannot go pass 3 weeks into future date. If so, it
is consider inactive. If can, i would like to add a column stated "Active" or
"Inactive"

For example
Beginning date is 8/12/2009
Ending date is 12/03/2010

If the beginning date after 3 weeks (9/2/09) then this is consider INACTIVE
 

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