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

Multiple conditions of an "If" statement

Avatar

Avatar
Validate 10
Level 2
Gene--O
Level 2

Likes

3 likes

Total Posts

76 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
Gene--O
Level 2

Likes

3 likes

Total Posts

76 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile
Gene--O
Level 2

27-07-2011

Hello All,

I am trying to create a timesheet that fills in days of the week for me. Specifically, I have a TextBox named "Day"  that I input the day of the week, such as "Friday". I then have NumericBox1 that I want to automatically fill in the number "7", since Friday is the 7th day of our work week. Likewise:

Saturday = 1

Sunday = 2

Monday = 3

Tuesday = 4

Wednesday = 5

Thursday = 6

Friday = 7

I have written the follwing in FormCalc as a Calculation Event:

if

(form1.TimeSheet1.Table1.Row1.Day.rawValue=="Friday","7")

this statement works. HOWEVER, when I try to add additional staements to effect the other day's values, I receive a value of "1" every time.

Would someone please help me correct this?

thanks in advance

Gene-O

View Entire Topic

Avatar

Avatar
Validate 10
Level 2
Gene--O
Level 2

Likes

3 likes

Total Posts

76 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
Gene--O
Level 2

Likes

3 likes

Total Posts

76 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile
Gene--O
Level 2

28-07-2011

Bibhu,

Thanks for your response!

I wrote this in FormCalc as a Calculate Event in the "Number" field:

If (form1.TimeSheet1.Table1.Row1.Day.rawValue=="Friday","7")

It works just fine: when I type "Friday" into the "Day" TextBox, it returns a "7" into the Number field

BUT:

I also wrote these, but no matter what I type ("Friday" or "Wednesday", etc) in the "Day" TextBox, it returns a value of "1" into the Number field in all instances:

If (form1.TimeSheet1.Table1.Row1.Day.rawValue=="Friday","7");

If (form1.TimeSheet1.Table1.Row1.Day.rawValue=="Saturday","1");

If (form1.TimeSheet1.Table1.Row1.Day.rawValue=="Sunday","2");

If (form1.TimeSheet1.Table1.Row1.Day.rawValue=="Monday","3");

If (form1.TimeSheet1.Table1.Row1.Day.rawValue=="Tuesday","4");

If (form1.TimeSheet1.Table1.Row1.Day.rawValue=="Wednesday","5");

If (form1.TimeSheet1.Table1.Row1.Day.rawValue=="Thursday","6");

I need statements that if I type "Friday", it returns "7";

If I type "Saturday", it returns "1";

If I type "Sunday", it returns "2";

If I type "Monday", it returns "3";

If I type "Tuesday", it returns "4";

If I type "Wednesday", it returns "5";

If I type "Thursday", it returns "6"

All of these need to be in one script as a calculate event in the "Number" field.

Thanks!!!

Gene-O