Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using 'Today' in Filemaker Calculations 2

Status
Not open for further replies.

Cradders

Technical User
Jul 21, 2005
25
0
0
FR
Hi, I'm pretty new to Filemaker programming so you'll need to talk me through stuff in very basic terms.

I'm creating a multi-relational database system to do all sorts of things I used to do with Excel - and although I understand the concepts of Filemaker I keep getting tripped up on simple things.

The main problem I have at the moment is trying to put Today into calculations. For example I'm trying to make a calculation for a job tracking system which tells me how many days are left until the next step deadline.

So NextStepDeadline is a date field, with a date in it.
In Excel I use: NextStepDeadline - Today()
and the result is the number of days remaining until the deadline from today's date.
But when I try to put Today in Filemaker, it doesn't get it.

Help! There are lots of other things I need to do using Today so this has got me stumped.
 
See what the function Status(CurrentDate) can do for you if you have FM lower than 7 and the Get(CurrentDate) in FM 7.

In lower than 7 it is not recommanded to use the Today function. Depends of how you use it, it can slow down your application because FM has to recalculate the records.

Better is to use the Status function.

In FM 7 they removed the Today...

HTH
 
Thank you!

Yes, I'm using Filemaker 7.

I put Get(CurrentDate) in my formula and it works fine.

Why on earth did they take away a function so essential and not put its equivalents (the ones you just gave me) into the Date function table??? It's beyond me. I've spent all morning trying to solve this puzzle.

Cheers,

Cradders.
 
Hello Cradders,

You must be on an older version of FileMaker. Many years ago the FileMaker company recommended that developers not to use the TODAY function anymore. I think there were problems with its accuracy if the database was open when the clock struck midnight. I believe the problem was that the function didn't recognize the change of day. As far as I know the TODAY function was removed from FileMaker back around the time of version 4.0.

In pre 7 versions try using:
Status(CurrentDate).

In version 7 try:
Get(CurrentDate) or Get(CurrentHostDate).

Either of those fumctions should do the trick.

Another key to using this is to make sure any calculations are set to NOT STORE the results.

-Striker
 
>>As far as I know the TODAY function was removed from FileMaker back around the time of version 4.0.

Nope, it's still there in FM 6.
Even when you convert a file to FM7, FM will make a sort of workaround.
Status(CurrentDate) was added in FM 4.

Problem with Today was also:If you are sharing a file that uses the Today function, the host must close and reopen the file each day for the function to update with the correct date.

But, your right, as not to use the Today at all, when lower than 7.

Even so with the Paste Current Date. It's more advisable to use Set Field with Status(CurrentDate), since it does not require the field to be on the current layout.

HTH
 
Hi Jean,

Actually Status(CurrentDate) was in version 3. I know that for a fact since the company that I work for ran on version 3.0v6 from the time it came out - around 1997 I think - until early 2004. In all those years I never used the TODAY function. I upgraded our system from v3 directly to v6 and then to v7 after that.

I do believe that you are correct that TODAY was still in v3 but its use was discouraged by then.

-Striker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top