473,651 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding 6 months to the issue date

Hello,
I am trying to automate a date. When typing in the issue date I
want it to automatically calculate 6 months fronm the issue date and
give me the Expiration date. Following is code that I am using:

<td>Visa Issued Date:</td>
<td><input name="visaIssue Date" type="text" size="8"
maxlength="8" value="#DateFor mat(get_NamesCo ntacts.VisaIssu eDate,
'mm/dd/yy')#" onBlur="checkDa te(this)"></td>
<td>Expiratio n Date:</td>
<td><input name="visaExpir eDate" type="text"
id="visaExpireD ate" size="8" maxlength="8"
value="#DateFor mat(get_NamesCo ntacts.VisaExpi reDate, 'mm/dd/yy')#"
onBlur="checkDa te(this)"></td>
</tr>

I have received feedback regarding what coding to use but it does not
seem to work. I would appreciate it if any one could help.

Thank you
Sandy
Jul 20 '05 #1
2 2489
sa**********@ya hoo.com (sandy) writes:
I am trying to automate a date. When typing in the issue date I
want it to automatically calculate 6 months fronm the issue date and
give me the Expiration date. Following is code that I am using: .... I have received feedback regarding what coding to use but it does not
seem to work. I would appreciate it if any one could help.


Some of the feedback you received suggested that you decide what "6
months later" is for, e.g., 31th of March or 30th of August. Just adding
six to the month number will give illegal dates (31th of September and
30th of February).

When you have decided what you want the result to be, I'm sure we
can find a way to give it to you.

(I have no idea what the "#"'s are doing in your code, or what the DateFormat function is doing).

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
JRS: In article <fb************ **************@ posting.google. com>, seen
in news:comp.lang. javascript, sandy <sa**********@y ahoo.com> posted at
Mon, 19 Jan 2004 05:42:32 :-
I am trying to automate a date. When typing in the issue date I
want it to automatically calculate 6 months fronm the issue date and
give me the Expiration date. Following is code that I am using:

<td>Visa Issued Date:</td>
<td><input name="visaIssue Date" type="text" size="8"
maxlength="8 " value="#DateFor mat(get_NamesCo ntacts.VisaIssu eDate,
'mm/dd/yy')#" onBlur="checkDa te(this)"></td>
<td>Expiratio n Date:</td>
<td><input name="visaExpir eDate" type="text"
id="visaExpire Date" size="8" maxlength="8"
value="#DateFo rmat(get_NamesC ontacts.VisaExp ireDate, 'mm/dd/yy')#"
onBlur="checkD ate(this)"></td>
</tr>

I have received feedback regarding what coding to use but it does not
seem to work. I would appreciate it if any one could help.


Read the FAQ.

Don't let your news software wrap lines; that mars legibility. Wrap by
hand, with consistent indentation.

If you have control of the system design, change that 6 months to 182
days. Less programming, and has the advantage of going to the same day
of the week - unless you want the next day of the week, when use 183.

The matter was discussed here last week, in a thread "Add six months to
a start date". Some of the solutions given there work well, and the
others have been sufficiently criticised.

Therefore, either you have mis-explained the question, or you have mis-
implemented the solutions given, or the correct answer is not that which
you are expecting, or there is some other difficulty.

We need a clear specification of the intent, including short-month
effects, the smallest code that demonstrates your problem, the results
you get in a given case, and the results you think you should have got.
We may also need to know which browser(s) are being used, and the
version(s).

--
© John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang. javascript
<URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
36186
by: Roy Riddex | last post by:
How do I add to a date? I thought the following code would work but it doesn't like it. I'm trying to add 6 months (182 days) onto a date. Option Explicit Private Sub Form_Load() Dim Answer As Integer Dim GivenDate As Date GivenDate = "2/1/2004" Answer = GivenDate + 182
16
41614
by: sandy | last post by:
Hi, Using Java script I am trying to create code where when you place in the start date it automatically calculates 6 months for the experations date. For example when I place 01/01/04 as the issue date the experation date should automaically generate as 06/01/04. I would appreciate it if anyone could help me. Thank you Sandy
11
14400
by: Bobbak | last post by:
Hello All, I have these tables (lets call it ‘EmpCalls', ‘EmpOrders', and ‘Stats') that each contain the list of EmployeeIDs, I want to be able to create a Module in which I could call in my VB form (by clicking and command button)that will add a column (field) to each table and label it with the current date that is specified in my form. Does anyone know how I can go about doing this? Any suggestion will be greatly appreciated.
6
2499
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new products). Tables: tblCategoryDetails CategoryID SpecID
1
1724
by: RobMea | last post by:
I am trying to find a solution to the following problem. First off I'm new to Access and SQL but have a good back ground in other languages, thus at a new job this has just been dumped on me so as is my style I agreed figuring that over time it's just another language and style anyway to add to the others I've worked in. Heres my situation. Have used a make table query to establish a Temp historical archive table for reporting...
14
1950
by: gorio | last post by:
I have a MySQL/PHP based page with a number of date fields that I would like the user to be able to run a script on to update the fields and then submit them for server processing. All my programming to date has been server side, but I feel this exercise is better done client side, hence my post on this group. However my javascript knowledge is very limited. So far I have something like this, I know it won't work like this but I've...
1
2946
by: Dan | last post by:
Hi I've got a quandry - I have a detailed database that handles advert orders between a design agency and printers / magazines etc. I want to add up the total spent by the client and put the results to a field. I've actually done that using a query table in access - it should be
4
6889
by: MCLR | last post by:
Good day to all: I found your website a couple of days ago as I was searching for resources that can help within my particular problem in writing a script for an Access Query. The issue is to calculate a month and year situation. What I need is to create a query that will pull up how many months and years an employee has been working at a (now) date. For example: Employee A as been employed 2 years and 4 months and Employee B as been...
2
2556
by: dympna | last post by:
Hi can anyone suggest a fix for this... as I am a novice in access. I have created a training table with the following fields Employee Name - joe Training Received - Fork lift Date Received - 20/6/07 Certificate - yes What I want to create is a renewal date for this training, there are
0
8347
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
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
8792
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
8457
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
7294
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
5605
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
4143
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
4280
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1585
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.