How to add 2 days to a date field?

Avatar

17-05-2007

How to add 2 days to a date field if a Saturday was selected on a different date field?



Thanks

Replies

Avatar

Avatar

gkaiseril

Avatar

gkaiseril

gkaiseril

17-05-2007

Test the formatted value of the different field for "Saturday" and then do your calculation.

Avatar

18-05-2007

Hello Geo,



Thanks for your reply, thats exactly what I need to do, but how do I do it? I do not have that level script knowledge.

This is the code placed in one of the field to add 1 day to the date field, but I need to add 2 days if the day selected is a "Saturday"



if (DateTimeField1.rawValue ne null) then

Num2Date(Date2Num(DateTimeField1.formattedValue, "EEEE, MMM D, YYYY")+ 1, "EEEE, MMM D, YYYY")



else

null

endif



I really appreciate any help, thanks guys

Avatar

Avatar

gkaiseril

Avatar

gkaiseril

gkaiseril

18-05-2007

My response to your other post:



if (DateTimeField1.rawValue ne null) then

if (Substr(DateTimeField1.formattedValue, 1, 08) eq "Saturday") then

Num2Date(Date2Num(DateTimeField1.formattedValue, "EEEE, MMM D, YYYY")+ 2, "EEEE, MMM D, YYYY")

else

Num2Date(Date2Num(DateTimeField1.formattedValue, "EEEE, MMM D, YYYY")+ 1, "EEEE, MMM D, YYYY")

endif

else

""

endif

Avatar

19-05-2007

Hello Geo,



Thank you, Thank you so much!



It works perfectly, all I did was copy your suggested code and pasted in my date field.



I hope some day I can return this favor to you some way



Thanks!

Avatar

29-05-2007

I ran into the same problem and used the recommended code. But for some reason, it will accept only May month dates and the calculations are correct. Any other dates besides a May date, the calculated fields returns January 1, 1990.



What am I doing wrong?



Thanks!

Avatar

11-01-2008

I am attempting to add a date field and then have a another field add an amount to a box if the date is less than 30 days. Later I want to update the form to have the today's date is less than 10 days.



Early Registration Fee is $10.00 if posted by February 25, 2008

Late Registration Fee is $20.00 if posted by March 17, 2008



It seems simple, but, when you get to be 71 years old, it seems difficult. Any help will be appreciated.



Here is a link to the form I'm working on:



http://www.aworldwide.com/Gideon/Convention_Registration.pdf



I am using a trial version of Adobe Acrobat 8.



Thanks,

Andy Anderson