dbTalk Databases Forums  

Round off date function (FM 7.0v3)

comp.databases.filemaker comp.databases.filemaker


Discuss Round off date function (FM 7.0v3) in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
42
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 03:00 PM






In article <1127105409.797205.193360 (AT) g44g2000cwa (DOT) googlegroups.com>,
leon.obers (AT) iae (DOT) nl says...
Quote:
leon.obers (AT) iae (DOT) nl schreef:

Still the refreshing issue as written within the other message has to
be solved.
Is the calculation unstored?


Reply With Quote
  #12  
Old   
Remi-Noel Menegaux
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 03:16 PM







Quote:
The same is true for times in FileMaker - they work in minutes, so
you
can simply add (or subtract) minutes by adding just the number and
FileMaker will calculate the result properly.
This is wrong (for FMP6 and FM7). FileMaker count the times in seconds
and not in minutes.

Remi-Noel




Reply With Quote
  #13  
Old   
Léon Obers
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 05:22 PM





42 wrote:

Quote:
leon.obers (AT) iae (DOT) nl schreef:

Still the refreshing issue as written within the other message has to
be solved.

Is the calculation unstored?
No, it is automatically written within the "Age" field the first time
you edit a date in the "Born date" field, as the Age field is set to do
a calculation within the field properties directly. So not by using a
separate script.

But typically when the time of the computer is passing and a date is
rolling over the birthday date, the field is not updated automatically.
You can test by switching the date of computer to another date manually.
Even a restart of the computer and closing the table and loading the
table again doesn't "refresh" the date.

Only a new edit of the "Born date" field again (even by typing the
original date again), do make a refresh of the "Age" field.
Exporting and importing the same table *does* refresh the field.

It seems to me, that the field has to be updated automatically as soon
as you change to a visible record at your screen, or click in a field or
window isn't it?
E.g. the same as you are jumping from one cel to another cel within
Microsoft Excel. "Refresh" calculations are done automatically.



--
Vr.groet - regards, Léon Obers

Reacties per mail, vervang "invalid" door "cc" in het adres.
Reactions by mail, exchange "invalid" by "cc" within address.



Reply With Quote
  #14  
Old   
Léon Obers
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 05:31 PM





Helpful Harry wrote:

Quote:
leon.obers (AT) iae (DOT) nl wrote:

The following line did the trick as far as for the proper day when
switching to birtday date itself and year difference in general.

Year((Get(CurrentDate) + Day(1)) - Birthdate) - 1

snip

Since the original question has been answered, I only have one quick
note. When adding days to a date you don't need the Day function.
FileMaker's dates work in days, so you simply add (or subtract) the
number of days.
eg.
Get(CurrentDate) + 1 adds one day
MyDateField - 3 subtracts three days

Thanks for your input.
In spite the other solution does work, I do like a solution better if
the basic rules are used as aimed at.

By the way, do you have some suggestions to "refresh" the Age
calculation automatically? The solution I found out as worked, is not a
nice method. I think FM should be set in a way that fields that are
related to current date are updated automatically.
E.g. Microsoft Excel, date fields (and all other calculations) are
automatically updated as soon if you jump from one cel to the other.
Seems not FM.



--
Vr.groet - regards, Léon Obers

Reacties per mail, vervang "invalid" door "cc" in het adres.
Reactions by mail, exchange "invalid" by "cc" within address.



Reply With Quote
  #15  
Old   
FP
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 05:57 PM



If you make the calculation unstored the age will update itself
automatically.


Reply With Quote
  #16  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 06:03 PM



In article <432f0301$0$32682$626a14ce (AT) news (DOT) free.fr>, "Remi-Noel
Menegaux" <rnmenegaux (AT) free (DOT) fr> wrote:

Quote:
When adding days to a date you don't need the Day function.
FileMaker's dates work in days, so you simply add (or subtract) the
number of days.
eg.
Get(CurrentDate) + 1 adds one day
MyDateField - 3 subtracts three days
TextToDate("18/5/2004") + 7 adds seven days (ie. 1 week)

This is right.

The same is true for times in FileMaker - they work in minutes, so you
can simply add (or subtract) minutes by adding just the number and
FileMaker will calculate the result properly.
eg.
Get(CurrentTime) - 15 subtracts 15 minutes
MyTimeField + 125 adds 125 minutes
(ie. 2 hours and 5 minutes)


This is wrong (at least for FMP6). FileMaker count the times in seconds
and not in minutes.
Oops! You're right it is seconds. For some strange reason I got minutes
stuck in my brina last night.

So to ad 3 minutes it should be:

MyTimeField + 180 (ie. 3 x 60 seconds)

Sorry if it caused anyone confusion. \



Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


Reply With Quote
  #17  
Old   
Léon Obers
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 07:23 PM





FP wrote:

Quote:
By the way, do you have some suggestions to "refresh" the Age
calculation automatically?

If you make the calculation unstored the age will update itself
automatically.
Have looked to extra options I didn't know before and yes,
works great. So everything is working now.

Thanks everybody. Marvelous forum. Brings much effort to the knowledge
of FM and working solutions.


--
Vr.groet - regards, Léon Obers

Reacties per mail, vervang "invalid" door "cc" in het adres.
Reactions by mail, exchange "invalid" by "cc" within address.



Reply With Quote
  #18  
Old   
Léon Obers
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 07:26 PM





Léon Obers wrote:

Quote:
42 wrote:

leon.obers (AT) iae (DOT) nl schreef:

Still the refreshing issue as written within the other message has to
be solved.

Is the calculation unstored?

No, it is automatically written within the "Age" field the first time
you edit a date in the "Born date" field, as the Age field is set to do
a calculation within the field properties directly. So not by using a
separate script.
Seems you can check the option not to store the result.
Didn't know the function before.
And yes, now it works fine. Thanks.

--
Vr.groet - regards, Léon Obers

Reacties per mail, vervang "invalid" door "cc" in het adres.
Reactions by mail, exchange "invalid" by "cc" within address.



Reply With Quote
  #19  
Old   
42
 
Posts: n/a

Default Re: Round off date function (FM 7.0v3) - 09-19-2005 , 11:03 PM



In article <dgndjd$k91$1 (AT) news5 (DOT) zwoll1.ov.home.nl>,
mail.to.me (AT) fotograaf (DOT) invalid says...
Quote:

42 wrote:

leon.obers (AT) iae (DOT) nl schreef:

Still the refreshing issue as written within the other message has to
be solved.

Is the calculation unstored?

No, it is automatically written within the "Age" field the first time
you edit a date in the "Born date" field, as the Age field is set to do
a calculation within the field properties directly. So not by using a
separate script
But typically when the time of the computer is passing and a date is
rolling over the birthday date, the field is not updated automatically.
You can test by switching the date of computer to another date manually.
Even a restart of the computer and closing the table and loading the
table again doesn't "refresh" the date.

Only a new edit of the "Born date" field again (even by typing the
original date again), do make a refresh of the "Age" field.
Exporting and importing the same table *does* refresh the field.

It seems to me, that the field has to be updated automatically as soon
as you change to a visible record at your screen, or click in a field or
window isn't it?
E.g. the same as you are jumping from one cel to another cel within
Microsoft Excel. "Refresh" calculations are done automatically.
Make it unstored. Then it refreshes whenever it needs to. (It probably
won't react to you just changing the date in the control panel, but it
will react to file opening/closing, moving between records, etc.)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.