473,624 Members | 2,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculating future Dates in a form to be stored in a table.

1 New Member
I am a beginer. I have been tasked at projecting failure dates of Batteries. Batteries have different failure rates. So when we install a battery "Change Date" and the known life is 3 yrs "Failure Time", I need that result to show up in a "Failed" date field. If a battery has a 10 year life, I need that to show up in the Failure Date field.
I cold see an expression in the "failed" field like =([ChangeDate]+[failureTime]) but it does not work. How stupid am I?
Jul 20 '12 #1
1 1855
Seth Schrock
2,965 Recognized Expert Specialist
Are the failure rates always in years? If so, what I would do would be to have a Change_Date field and a Failure_Rate field in the table. You would then use a query to calculate the actual failure date. I do it this way because you aren't supposed to store calculated fields (read Database Normalization and Table Structures for the reason).

Your query would work like this:
Expand|Select|Wrap|Line Numbers
  1. SELECT Change_Date,
  2. Failure_Rate,
  3. DateAdd("YYYY",Failure_Rate,Change_Date) AS Failure_Time
  4. FROM table_name
  5.  
You can then base your forms or reports on this query.
Jul 20 '12 #2

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

Similar topics

7
2160
by: JLM | last post by:
I have a table that has fieldA, fieldB, fieldC. I want fieldC=fieldA-fieldB. simple enough. the next record I want to be able to do the same on the new value of fieldC. I can do this with SAP ABAP/4, but have never done this using Access. I'm sure this can be done, but not sure how to go about it. thanks in advance, jlm
3
1625
by: Lumpierbritches | last post by:
Can this be done in access by a lay person? Also, are there any tutorials for this type of addition to your applications? I'm trying to use a calendar control to set a date in the future for a to do list, similar to a PIM. If the date exists, then I want to open that date, if it doesn't I want to create that date. Thought about make table query, but not sure to go from there. Any help would greatly be appreciated. I searched Deja News...
2
7969
by: Bill Hand | last post by:
Is it possible to open a form from table and have it access a given record? I want to be able to query all baseball cards with the last name Jones and have it open a table. In each record of the table I have a hyperlink field that opens a form. Now say I have 10 Jones' and I want the form to open up to Andruw Jones not Chipper Jones. Is this possible? This is more of a curiosity question than anything.
2
2085
by: Carl | last post by:
Hi, I have a query that produces an output similar to the sample shown below. These records are based on certain criteria and a date range selected from a form. I need to create some kind of calcualtion or record manipulation to do the following: I need to subtract dates from one another, for example for ID 1 I want to find the difference between 24-Jun-04 and 25-Jan-06 for the 2 applications for Person1.
3
6190
by: KayC | last post by:
Hi Background info: I am running Access 2000 I have a form bound to a blank table When a user clicks a button the form opens in datasheet view User enters data into form and closes form User clicks button which then creates an inner join between form bound table and master table and updates records in master table where values are equal to form bound table
0
2540
by: abhishekjethwani | last post by:
How to write a query to access tree structure form multi table. I m having five tables from them first table give me a data which act as the parameter for query for the second table and the two tables will give me parameter for the third and so on. at present i m writing five query and sending parameter to each query but i want an efficient way for this. its a parent child type relation.
4
3742
by: Toine | last post by:
Hello, I'm new to Python so please bare with me... I need to calculate a date that is exactly 31 days from the current date in YYYY-MM-DD format. I know that date.today() returns the current date, but how can I add 31 days to this result? I'm sure this task is simple, but I haven't been able to figure it out. Thanks
3
2146
by: mlcampeau | last post by:
Hi guys, I am trying to run a query that calculates when employees become eligible for supplemental vacation. This occcurs once the employee has reached 5, 10, 15, etc years of service. I got the query running great, it shows the correct dates, (5, 10, etc years after the HireDate) but I just found out that they don't want to know the exact anniversary date. People become entitled to their vacation January 1st of the year of their anniversary...
31
2195
by: Pramodpmenon | last post by:
Dear All, Can Some body help me on this, im just new to access, and now im trying to develop a database for Human resourses. The problem im facing is that, i need to check all the passport expiry dates of employees and compare it with now() & if its less than one month must give a mssge box. How can i doo all these, how can i compare all the dates in a table in start up itself and give the Mssge? Please help me I have a Table called...
1
5888
by: jack1257 | last post by:
In this procedure im comparing two dates. Its the stored procedure could be executed. Im face an problem when executing this stored procedure. Error:exec sp_valid @coupon_no = 101 Msg 242, Level 16, State 3, Procedure sp_valid, Line 13 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. Msg 241, Level 16, State 1, Procedure sp_valid, Line 17
0
8179
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8348
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7176
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1493
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.