![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Not the prettiest but will work Int( (Year(Get(CurrentDate )) + Month(Get(CurrentDate )) / 100 + Day(Get(CurrentDate )) / 10000) - (Year(BirthDate) + Month(BirthDate) / 100 + Day(BirthDate) / 10000)) |
#4
| |||
| |||
|
|
Or more simply: (year(currentdate)-year(birthdate)) - if(date(month(birthdate), day(birthdate), year(currentdate) <currentdate,1,0) Do the calculation, as you did, and then test for the condition that 'this years' birthday hasn't happened yet, and subtract 1 if that's the case. |
#5
| |||
| |||
|
|
Do the calculation, as you did, and then test for the condition that 'this years' birthday hasn't happened yet, and subtract 1 if that's the case. |
#6
| |||
| |||
|
|
Or more simply: (year(currentdate)-year(birthdate)) - if(date(month(birthdate), day(birthdate), year(currentdate) <currentdate,1,0) Do the calculation, as you did, and then test for the condition that 'this years' birthday hasn't happened yet, and subtract 1 if that's the case. Your right, this is much easier. I think you meant to have a greater than sign instead of a less than so that is would look like: (year(currentdate)-year(birthdate)) - if(date(month(birthdate), day(birthdate), year(currentdate) currentdate,1,0) This can be simplified to |
#7
| |||
| |||
|
|
In article a (AT) pottnerconsulting (DOT) ca says... Or more simply: (year(currentdate)-year(birthdate)) - if(date(month(birthdate), day(birthdate), year(currentdate) <currentdate,1,0) |
#8
| |||
| |||
|
|
Still the refreshing issue as written within the other message has to be solved. |
#9
| |||
| |||
|
|
42 schreef: In article a (AT) pottnerconsulting (DOT) ca says... Or more simply: (year(currentdate)-year(birthdate)) - if(date(month(birthdate), day(birthdate), year(currentdate) currentdate,1,0) 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 |
#10
| |||
| |||
|
|
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) |
|
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) |
![]() |
| Thread Tools | |
| Display Modes | |
| |