Help with if and elseif

Avatar

16-05-2007

I have this script working fine:



if (DateTimeField1.rawValue ne null) then

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



else

null

endif



But I need to add 2 days if the first date selected is a SATURDAY



Thanks in advance for any help!

Replies

Avatar

Avatar

gkaiseril

Avatar

gkaiseril

gkaiseril

17-05-2007

Have you considered testing a substirng of the formatted value of the DateTime1 field for "Saturday"?



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