Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

If Statement

Avatar

Avatar
Level 2
DonKeating
Level 2

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
DonKeating
Level 2

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
DonKeating
Level 2

30-03-2009

Since today is March 30, 2009 it seems to me this formula would use 25. But, it doesn't. It uses 20. Since March 30 is certainly greater than March 27, why does it do that?



form1.#subform[0].Table2.Row1.NoReg * if(date2num(date(),"MMM DD, YYYY")> date2num("Mar 27, 2009","MMM DD, YYYY"),25,20)



Thanks.




Replies

Avatar

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct Reply

0 solutions
View profile

Avatar
Level 5
_SekharN_
Level 5

Likes

0 likes

Total Posts

246 posts

Correct Reply

0 solutions
View profile
_SekharN_
Level 5

30-03-2009

I would change your logic to the following FormCalc code.....



if (Date() > date2num("Mar 27, 2009","MMM DD, YYYY")) then

form1.#subform[0].Table2.Row1.NoReg * 25

else

form1.#subform[0].Table2.Row1.NoReg * 20

endif

Avatar

Avatar
Boost 5
Level 7
gkaiseril
Level 7

Likes

13 likes

Total Posts

456 posts

Correct Reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Level 7
gkaiseril
Level 7

Likes

13 likes

Total Posts

456 posts

Correct Reply

2 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
gkaiseril
Level 7

31-03-2009

When writing scripts, many languages require strict capitalization of key words as well as correct spelling. In LiveCycle Designer one uses 'Date'.

Avatar

Avatar
Level 2
DonKeating
Level 2

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
DonKeating
Level 2

Likes

0 likes

Total Posts

9 posts

Correct Reply

0 solutions
View profile
DonKeating
Level 2

01-04-2009

Thanks SekharN and George for you reply.



I'm now using this and it seems to be working OK.



if(Date()> date2num("Mar 27, 2009","MMM DD, YYYY"), 25, 20) * NoReg



Although I'm new to FormCalc and JavaScript I'm not new to coding. Been developing software using dBase, Clipper and Xbase++ since DOS days. And, I'm aware that each language has it's quirks. Surprised I didn't notice that uppercase "D" on date(). Will continue to study.



Anyway thanks again.




Avatar

01-04-2009

I have never done scripting. I have 2 text objects, A1 and A2. I want if A1 is empty then A2 is the word "NONE". How do I write this in Form Calc? Thanks.