473,506 Members | 14,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to update a date field based off of another date + x amount of months?

I have a date that is used to show when someone completed a task and the task is due again in 12,24,48 months. I am trying to update a field for the next due date. Of course after I get this done, I will build a query report to show anyone that is going to be due again in the next 30 days.
Nov 1 '10 #1
3 1907
jimatqsi
1,271 Recognized Expert Top Contributor
If OldDate is the date completed, and NewDate is the date due again:

Expand|Select|Wrap|Line Numbers
  1. NewDate=DateSerial(Year(OldDate)+1,DateSerial(Month(OldDate),Day(OldDate))
  2.  
The +1 is for 12 months.

You will have to add some logic to check that the due date does not fall on an illegal date, like Feb 29 in a year that is not a leap year. Or just force all due dates to be the first or last day of a month my changing the Day parameter in the DateSerial function.

Jim
Nov 2 '10 #2
Ok.. so I have the formula to get the "Due" date, but it does not update the field in the table. It will show on the form, but it does not carry over into the table.
Nov 3 '10 #3
jimatqsi
1,271 Recognized Expert Top Contributor
You're going to have to fill in some details. What event is triggering the calculation of the due date? Is your due date text box bound to the relevant data item? Show us some code.

Jim
Nov 4 '10 #4

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

Similar topics

4
16179
by: Michael Haas | last post by:
Need some hwlp with comparing a date field retrieved from an access date base to the current date. Basically I'm looking to create and if statement like: If strArticleDate < = Current Date then...
13
6541
by: pkinville | last post by:
ok, this is gonna seem stupid, but it has been stumping me all afternoon. I have two fields on a HTML page. HTML looks like this... <html> <head> <title>New Page 3</title> </head> <body>
1
2512
by: Tony Johnson | last post by:
I want to update a particular field in a form for only a certain set of records. The certain set of records is named Financed. I need to update those Financed records with a financed number that...
1
5925
by: itfgnanvigneshwari | last post by:
hai, as i am new to php field i had a problem in date field. i have table named student with fields fieldname type name varchar...
1
1984
by: Killer42 | last post by:
Hi all. I have a question from a colleague. He is creating a form in Word2003, which has a date field on it. He wants to set the default value to the current date, but allow the user to overwrite...
22
3566
by: tonialbrown | last post by:
I have an Sql update statement that I am using that updates the data from a record chosen by the user from a list box lstDelFrom. This is working for all the text fields & updates fine. Once I add...
15
3551
by: kpfunf | last post by:
I have one table of transactions, another table of price quotes. Transactions are nearly daily; quotes are periodic, roughly once per week. In a query, I want to pull the oldest (or least date)...
7
52221
by: jmartmem | last post by:
Greetings, I have an ASP page with a form (form1) that contains a JavaScript validation function that is activated onSubmit. The function contains a series of IF statements to alert the user to...
3
5920
by: Cron | last post by:
Hi I'm trying to Dcount *unique* records by comparing a date/time field. I say *unique* because the field contains a date/time but I need to ignore the timestamp and work off the date only. I...
9
8897
by: yappy77 | last post by:
I want my "requalify date" to auto populate to the beginning of the month in the following year when my "liability date" gets entered/changed. Example: Liablity date = 11/15/2010; 7/31/2011 ...
0
7308
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,...
1
7023
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...
0
7479
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
5617
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,...
1
5037
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
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...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
410
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...

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.