G-Mayor's code doesn't work to Calculate A Past Or Future Date??

S

StacyInPasadena

Hi, I'm trying to use Mr. Mayor's code from his zip file (available via
http://www.gmayor.com/index.htm) to calculate a future date. The example it
displays appears incorrect. It also provides incorrect data when I use it in
my file. I've pasted his directions below. I believe his suggestion:
"Wrapping the related fields with a QUOTE field, as in the penultimate
example, overcomes this" is the solution, but alas, I do not know how to do
this. Nor do I know how to copy the code for your review...?

Here is what I have and I only want the first part to show on my final
document.

Wednesday, 29 October 2008. (start date)
The offset is 14 days. (start date + xdays (offset) to generate "new date")
The new date is Thursday, 11 December 2008.


"The following examples use an ‘ASK’ field to get the starting date and
delay from which to calculate a past or future Gregorian calendar date:
If the starting date is Monday, 1 January 2001 and the offset is 1 day, then
the new date is Thursday, 1 May 2008.
Note: The field includes a test for whether the delay equals +/- 1 day, plus
error-checking code to validate the input.
or:
The starting date is Monday, 1 January 2001.
The offset is 1 days.
The new date is Thursday, 1 May 2008.
or:
The starting date is Monday, 1 January 2001.
The offset is 1 day.
The new date is Thursday, 1 May 2008. (MVPs: this is incorrect isn't it? One
offset day would be 2 January 2001?)

Note: In the last of these examples, the fields are independent of each
other and the two rows do not automatically update when the starting date or
delay is changed. Wrapping the related fields with a QUOTE field, as in the
penultimate example, overcomes this."
 
M

macropod

Hi Stacy,

I gather you're using one of the examples from the 'Interactively Calculate A Past Or Future Date' topic in my Date Calc tutorial.
The first and second examples for that topic already have the QUOTE field wrapping.

If you're getting an unexpected result, I suspect it's because you're using different regional settings to what I used to create the
document. The need to modify the field coding to suit your regional settings, and a macro to do that, is discussed in the tutorial's
'Introductory Notes' (under the heading 'Date input/output formats'). You may also need to modify the output formatting to suit your
needs - as also discussed under that heading.
 

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