473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Create automatic flag based on expiration dates?

I put together a quick database for agreements, which have an executed date and an expiration date. Is it possible to create a field which would say auto generate "Expired" if the expiration date has passed?
Jan 9 '19 #1
2 1473
twinnyfo
3,653 Expert Mod 2GB
bradford80,

Welcome to Bytes!

Is it possible to create a field which would say auto generate "Expired" if the expiration date has passed?
The short answer is "Yes."

The long answer is, "How do you want to do that?"

One thing about MS Access is that it won't do anything in the background unless you tell it to do something. So, things don't just "run" as if you had wound up a clock.

There are several approaches to your question.

One approach would be to check for the expiration of a record each time it is accessed--for example, when someone takes a look at that record, it checks to see if the date is expired and then updates an Expired flag that now indicates the record is expired. There may be some value in approaching it this way.

However, the most significant shortfall with that approach is that this will only update that flag when a record is expired and it has been viewed. So, another approach might be for the database to assess all records when it is opened and check all records for expiration and assign that flag if they meet the criteria. This allows you to run queries based upon that flag--for example, pulling a list of all expired records.

However, the one shortfall with that method is that it creates unnecessary information in the Database (it is a field based upon a calculation of information in the currect record--which is usually frowned upon). The Yes/No flag is a separate field that would take up additional space for each record. This is typically not an issue for the size of DBs most Access gurus develop--but the principle holds true.

So, my recommendation is to not use a flag, but simply use the criteria of the current date being greater than the Expiration Date. So, for example, every time you run any queries and need the expired records, your Criteria would be:

Expand|Select|Wrap|Line Numbers
  1. WHERE Date() > [Expiration Date]
I hope this hepps you understand some of the underlying principles. But, it is up to you to determine the best way for your particular needs.

Standing by if you need additional assistance.
Jan 9 '19 #2
NeoPa
32,556 Expert Mod 16PB
Yes it's possible.

However, it's frankly a daft idea. Such an indicator should be created as part of a query that you report on and should not be used to update data as you'd be creating dependent data. That would be non-normalised and generally a BAD(tm) idea. See Database Normalisation and Table Structures for more on that concept.
Jan 10 '19 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Chris Powell | last post by:
I am using Excel/Access 2000 and have two large Excel files (25,000 rows each) that I wish to create linked tables in Access rather than importing into Access. The two source Excel files change...
0
by: neoteny2 | last post by:
I need MS Access to automatically create reports/subreports based on specific criteria. I am building a database in Access 2003 with different locations/sites. I have the "sites" table created...
4
by: alex.hatzisavas | last post by:
Dear all, I'm trying to do a selective deletion from an 'Archive' table based on dates. Here is the setup: Table 'Archive' has a date field ( ). Another table ('Cutoffs') defines the Low...
2
by: cpchan | last post by:
Hello, Can I create a Web-based application (not a Web site) with Visual C# 2005 Express ? Or I have to use Visual Web Developer 2005 Express Edition, choose ASP.NET and then choose C# ? Are...
1
by: experience4me | last post by:
Hello, I need to have access send an automatic email based on a trigger. The trigger will be a date plus 7 or 30 days. Is this possible. I know some Visual basic. Thanks...
0
by: josur | last post by:
Hi, I would like to know if is possible to create dynamic reports based on cubes. What i mean is,after creating a cube with a couple of dimensions and measure if is there any way to give the...
5
by: cLoque | last post by:
Hi, I would like to know how to create a dictionary based matrix. Where column and row are considered in placing my desired value. and will pass value as dictionary just like this def...
2
by: PaulaCM | last post by:
Is there a way to create a Form based on a Query? Everyone in my database has a staff point person assigned to them. I've created a query for each person where they can find only their contacts. ...
1
by: v0id | last post by:
I'm wondering how can I create a time-based loop that runs based on a certain interval i.e. something similar to: while 1: # do something time.sleep(1) but more elegant and...
15
by: jt196 | last post by:
I'm trying to create an editable form of fulfilled orders on my system and am running into problems with creating a form based on this query. The field that I need to update (invoice number) is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.