Jaume Posted July 7, 2004 Posted July 7, 2004 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.
Fitch Posted July 7, 2004 Posted July 7, 2004 Something like this: Case( Status(CurrentTime) > Time(17, 0, 0), "Good Evening", Status(CurrentTime) > Time(12, 0, 0), "Good Afternoon", "Good Morning" )
Jaume Posted July 7, 2004 Author Posted July 7, 2004 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
Fitch Posted July 8, 2004 Posted July 8, 2004 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.
Jaume Posted July 9, 2004 Author Posted July 9, 2004 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
Lee Smith Posted July 9, 2004 Posted July 9, 2004 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
Recommended Posts
This topic is 7511 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now