July 7, 200421 yr I would like to show, at the entrance layout of a file, a greeting text ("Good morning,...afternoon...evening") changing in function of the current time. I have tried to make a calculation with the Status(CurrentTime) function and the logical <, >, but it doesn't work if I put the AND condition.
July 7, 200421 yr Something like this: Case( Status(CurrentTime) > Time(17, 0, 0), "Good Evening", Status(CurrentTime) > Time(12, 0, 0), "Good Afternoon", "Good Morning" )
July 7, 200421 yr Author Thank you, Fitch, it is really simple (for you, obviously, not for me...) but... with this first condition Case( Status(CurrentTime) > Time(17;00;00) The result is ALWAYS the same, because it is always true that actual time is greater than 17:00 (well, almost always, except at 17:00 o,clock); so, the other two conditions will be never tested. The calculations must be : Case( Status(CurrentTime) < Time(nn;00;00) AND Status(CurrentTime) > Time(ss;00;00); `Good Evening
July 8, 200421 yr So you're saying that 16 is greater than 17? Did you try my calculation? OK, you're forcing me to go and test it, grumble, grumble... There. I tested it and it works. From 5 pm until midnight, you'll get Evening, from noon until 5 you'll get Afternoon, and from midnight until noon you'll get Morning. If you prefer, you could invert it: Case( Status(CurrentTime) < Time(12, 0, 0), "Good Morning", Status(CurrentTime) < Time(17, 0, 0), "Good Afternoon", "Good Evening" ) If you're using a calculated field rather than a script for this, make sure the field is unstored to ensure the Status function updates properly.
July 9, 200421 yr Author Yes, Tom, excuse me. I really did try your solution and it was fine the first afternoon, but , in the next morning, the message were the same, `Good Afternoon
July 9, 200421 yr Hi Jaume, The calculation should be the same for your Spanish Edition of FileMaker, as our US edition. However, the names of the fields will be your Field Names, and Names of the functions names should be the ones used in the Spanish Edition. Usually when a calculations works the first time, but fails to update as you have described, it means that the calculation is being "Stored". You need to change the Storage Option to Do Not Store. HTH Lee
Create an account or sign in to comment