Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 8046 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a calc display at the top of my menus. It's a simple display day/date as follows:

DayName(Today) & ", " & DateToText(Today)

However, at random (?), it disappears. There is nothing else in that space. I know that Vaughn has frequently recommended using Status(CurrentDate) over using Today. Is this one of the reasons, or is something else going on? I want this calc to ALWAYS display. Any ideas? confused.gif

Posted

The 'Today' function and the 'Status(CurrentDate)' function work quite differently, although their functions are (obviously) related.

'Today' has the distinction that it automatically recalculates on full throughout the entire database each time the database is opened on a new date. This means that providing your database will be closed and opened each day, you can count on the calculations being up to date - and therefore, calculations using 'Today' can be stored and indexed.

There are two problems with 'Today' however. They are:

1. If the file size is large and 'Today' has been used in various places (eg throughout a multi-file solution), every record in every file has to be recalculated in full before the solution can be used, every time it is opened. In a big solution with hundreds of thousands of related records, this can take quite some time.

2. If the file is to be hosted on a server, typically it would be left running around the clock, and therefore there is no prompt for 'Today' to recalculate, and it will fall behind. Clearly this defeats the purpose.

'Status(CurrentDate)' does not have any trigger to force recalculation in the way that 'Today' has, so it doesn't have either of the problems mentioned above. However, for this reason, if it is stored it will fall behind, updating only when some other event forces the field it resides in to recalculate (eg in the case of the field you are describing that would almost never happen). For this reason, 'Status(CurrentDate)', when used in calculations, must always be unstored.

Unstored calculatinos are always calculated fresh whenever they are needed for display or any other purpose, so 'Status(CurrentDate) in an unstored calc is always up to date. Moreover, since the processor cycles required to calculate it on the fly are minimal, users are unlikely to notice any slow-down (unlike the potentially long waits at start-up which can occur when the 'Today' function is used).

Having said all that, I have answered your second, more general question, but not the first one. You may wish to consider in light of the above, whether you would be better off with Status(CurrentDate) - but that won't solve the problem which is the main reason for your post.

The fact is that nothing you've included in your post would account for your calculation disappearing from the display - so, as you say yourself, there must be something else going on. You'll need to say a little more about when it happens and how the layouts it happens on are set up, in order for it to be possible to do more than guess about what is causing the 'dissappearances'.

Posted

Hi Ray! Thanks for the clarification on Status(CurrentDate) -- I'm glad I asked the question ... I apologize for being 'vague' about my calc and, in the future, will try to provide more information in my posts. The above referenced calc is displayed on all form views in Clients. I made sure the field was large enough to entirely display the largest entry (as I've noticed that a too-small field won't display a calc's content if it can't display it all.) The calc is text, do not evaluate, index is auto, OFF is clicked, (calculate if needed) and the Do Not Store is de-selected (so it's storing, right?). I have ONLY been working in the Clients db. I have been working on a form with FINDS and scripts attached to Perform Find. I KNOW it's happend at that time, when I then go back to a General Information form. That is the only 'predictable' behavior I've noticed, although I'm not SURE it always happens then. The FIND form is a 'duplicate layout' of General Information ... I just deleted everything I didn't need ... I 'think' I deleted the display of that calc on the FIND form but it's at home and I can't check right now.

I hope that helps ... regardless, I'm changing the formula to Status(CurrentDate) right now ... but if I could understand why it was disappearing, it may help me in other instances in the future.

Posted

It's possible that you need to make the field wider. If the day name is too long, it may be forcing the rest of the date to wrap to the next line which is not visible.

Posted

Thanks for the idea Bob. I stretched the field to half the width of the page and it's 12 pt, so it could fit the largest day and date, twice. On the same day/date, sometimes it'll show and sometimes it won't. Hmmm, maybe these ole' eyes are giving out ... no, that's not it either (although I HAVE been very tired). I thought maybe it's because I have it STORED ... hey, you know we had a time change yesterday! And, over the past week, I've been changing my system date/clock to force our DOS accounting system to work backward in time. Do you think maybe? As Ray says, Today is very funky in that aspect.

Posted

As Ray says, it should definitely be unstored, and you should use Status(CurrentDate) for this situation.

BTW, it will disappear when you are in find mode.

Posted

Yes, in find it disappears -- but it stays gone when I go back to browse in another layout! Thanks Bob, I've already changed my calc ... well, I'm TRYING to change it. blush.gif It seems all I can get it to display now is MONDAY (nothing else). Calc is text, do not evaluate, UNSTORED (smile), index off: DayName(Status(CurrentDate) & ", " & Status(CurrentDate)) and I get Monday!

I've tried: DayName(DateToText(Status(CurrentDate) and I've tried Case and Choose ... and, well blush.gif I have a lot to learn about formulas!

Ideally, I would like: Monday, October 28, 2002

I'd settle for my previous display of Monday, 10/28/2002

They say ignorance is bliss, but they lie! Ignorance is irritating! Can you help me out?

Posted

Make sure that you have the result type of this calculated field defined as text, not date. As soon as you use a function like DayName() the entire calculation result becomes text and if the result type is defined as date, the whole thing will disappear since it won't be a valid date.

Posted

Yes, it's defined as text but

DayName(Status(CurrentDate) & ", " & Status(CurrentDate))

still only displays Monday. I even spread the field across the whole page.

If I change it to:

DayName(DateToText(Status(CurrentDate) & ", " & DateToText(Status(CurrentDate)))) - even the Monday disappears!

What would YOU use to create Monday, October 28, 2002? You don't even have to give me the whole formula, just ... what else could I try to put them together? Doesn't Status want some sort of result? Result1, Result2? I don't understand how to make it just show it's silly date in a text field, I guess. confused.gif

Posted

No calculation at all. Create a text object that contains just two slashes "//" which are the date symbol. Then, with the whole text object selected go to the Menu Format>Date.... In the "Format As" popup pick the bottom item that shows the Weekday, Month, Day, Year.

Other markers that you can put on your layouts are:

@@ - Current record

## - Page Number

:: - Current Time

// - Current Date

Posted

Oh, thank you Bob! How simple! Now, just to be sure, I'm assuming that will give me the same functionality as Status(CurrentDate)? I'm going on that assumption! Thanks again ... sorry I was so thick! I was looking for a calc ... and instead I get //. Go figure! tongue.gif I still don't know why the other calc kept disappearing and I wish I knew for future's sake ... but at this point, may it rest in peace!

Posted

Sorry for my ignorance because I did not read thoroughly through this thread. Are you just trying to get a field to display the current date with day? Hows about this:

A calc field, unstored = Status(CurrentDate). Then in layout mode, click on the field and go to Format/Date. Click on the Format as radio button and select the format that has the day/month format.

Like I said, I didn't read this whole post im just throwing out suggestions and what not.

Ken

Posted

Hi Ken! smile.gif Well, I was having problems displaying day/date with Today function. I tried changing it to use Status(CurrentDate) when Vaughn discussed the problematic behaviors of Today, but never could get it to work. So I went back to my old formula using Today. Well {Today} kept giving me problems by 'disappearing' so everyone, particularly poor Bob, was helping me. However, I don't know formulas and I assumed I needed a calc including Status(CurrentDate) ... and, as you and Bob pointed out ... I don't. Just // and change field format to display the way I want! That one tired me out!! tongue.gif Thanks for stepping in to help!

Posted

Look carefully, what I will not tell you was already said more then once..using the system options to display the date-format..

for your former problems (which are perhaps a passed station..) I would have chosen for separating the elements in two, the Dayname thing and the date thing, and use 2 merge fields to add them on your lay-out. 1) you keep them flexible despite different lenght outputs and 2) you can see which field flips out..

harryk (an addicted hobbyist..)

Posted

Today has *one* advantage over Status(CurrentDate) -- it can be indexed, which means a calculation that uses Today can be used to generate a value list. However it'll break for all of the reasons Ray et al have already mentioned, so I only ever use Today for solutions where I need the field to be indexed AND I know it'll only ever be single user AND it won't be hosted on a server machine. Which means not very often.

LaRetta, what are you trying to achieve? If you want a little clock to appear on your layout with a live date and time showing... forget it. Neither Status(CurrentDate) nor Today nor the date and time codes (that Bob cleverly remembered!) will do a live updating display without some method to continually refresh it. It can be done with a looping script but I think it causes too many other problems to even bother with.

Posted

Hi Vaughan, All I wanted is a display of Monday, October 28, 2002

I had a calc using Today, although it displayed as Monday, 10/28/2002 and I was fine with that until I read your post about Today. I then tried to change it to DayName(Status(CurrentDate) and then DayName(DateToText(Status(CurrentDate ... anyway, never could get it to work.

I never realized that // would also work (then formatting the date field). I thought I had to combine it in a calc somehow. Anyway, Time began to give me problems (as it does more and more as I get older)! It began disappearing at strange times. Anyway, I decided that 1) I wanted to know WHY the calc was disappearing, as I believe problems can actually be invaluable learning tools and 2) I wanted a real-live display across my menus i.e. Monday, October 28, 2002!

It's all your fault that I wanted to switch from Time! grin.gif

I'm sure glad I did -- my db already loads and runs faster!

Posted

Yes, it's defined as text but

DayName(Status(CurrentDate) & ", " & Status(CurrentDate))

still only displays Monday. I even spread the field across the whole page.

If I change it to:

DayName(DateToText(Status(CurrentDate) & ", " & DateToText(Status(CurrentDate)))) - even the Monday disappears!

Both expressions have the parens placed poorly. You are concatenating the dates together with a comma between, and then getting the Day name of that pair. Try this:

DayName(Status(CurrentDate)) & ", " & Status(CurrentDate)

or:

DayName(Status(CurrentDate)) & ", " & DateToText(Status(CurrentDate))

HTH. Amazing what one misplaced paren can do to a stupid computer! wink.gif

  • 2 weeks later...
Posted

Well go figure!! Everyone helped me try to solve this one ... the calc would disappear at random ... at least that's what I thought! Calc was:

DayName(Today) & ", " & DateToText(Today)

We determined that it wasn't the best calc to use to display -- and I changed my other dbs to use // ... but I left this one because it bugged me that I didn't understand WHY it was disappearing. Well, it was a new empty clone. And, being a NEWBIE, I didn't know that, if there are no records, calcs won't display. Well, none of you asked that question, either grin.gif I just didn't think to tell you that it didn't have any records!! crazy.gif I mean, what RELEVENCE could that have had??

Well don't bother to download the layout (unless you're just curious to see what excellent FIRST designs I can do) -- we all know why it was disappearing now. But I'm GLAD I left it until I understood, and the next time some newbie asks "why is my calc disappearing?" Yup, I'll know! grin.gif

Clients.zip

This topic is 8046 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.