初心者のFileMaker pro Q&A (旧掲示板)

みんなに優しく、解りやすくをモットーに開設しています。 以下のルールを守りみんなで助け合いましょう。

1.ファイルメーカーで解らない事があればここで質問して下さい。 何方でも、ご質問・ご回答お願いします。 (優しく回答しましょう)

You are not logged in.

Announcement

新しい掲示板は、こちら:https://fm-aid.com/forum/t/filemaker


#1 2020-12-09 15:03:59

山田
Guest

経験年数の出し方について

環境 FM18 Win10

経験年数が下記計算式だとマイナスと出てしまって困っています。

日付    例 2020/12/9 入力

雇用年月日 例 2020/12/9

の場合、経験年数 0年0カ月

ですが、下記の計算式で
経験年数 マイナス -1年11カ月

どうしたら「0年0カ月」と出ますか?

計算式は、前に働いていた方が考えてくれたもので
私が考えたものではありません。

ファイルメーカー初心者の私にご教授いただけますでしょうか。
お手数ですが、よろしくお願いいたします。


期末日:日付(グローバル)

勤続年数月仮
Choose(
Month(期末日)-Month(雇用年月日)
+(Month(雇用年月日)>=Month(期末日))*12
+(Day(雇用年月日)<Day(期末日))
;12;1;2;3;4;5;6;7;8;9;10;11;12;1)-1


勤続年数月
If( GetAsNumber(勤続年数月仮) = 12 ; 0 ; 勤続年数月仮 )

勤続年数年月
If( GetAsNumber(雇用年月日) = "" ; "" ; GetAsNumber(勤続年数年) & "年" & GetAsNumber(勤続年数月) & "ヵ月" )

勤続年数
If(If(Month(Today) > Month(雇用年月日);Year(Today)-Year(雇用年月日);If(Month(Today) < Month(雇用年月日);Year(Today)-Year(雇用年月日)-1;If(Day(Today) >= Day(雇用年月日);Year(Today)-Year(雇用年月日);Year(Today)-Year(雇用年月日)-1)))>=150; ""; If(Month(Today) > Month(雇用年月日);Year(Today)-Year(雇用年月日);If(Month(Today) < Month(雇用年月日);Year(Today)-Year(雇用年月日)-1;If(Day(Today) >= Day(雇用年月日);Year(Today)-Year(雇用年月日);Year(Today)-Year(雇用年月日)-1))))

勤続年数年
If( GetAsNumber(勤続年数月仮) = 12 ;
Year(期末日)-Year(雇用年月日)
-(Month(雇用年月日)>Month(期末日))
-(Month(雇用年月日)=Month(期末日)and Day(雇用年月日)>=Day(期末日)) + 1 ;
Year(期末日)-Year(雇用年月日)
-(Month(雇用年月日)>Month(期末日))
-(Month(雇用年月日)=Month(期末日)and Day(雇用年月日)>=Day(期末日)))

#2 2020-12-09 16:11:39

チポ
Member

Re: 経験年数の出し方について

あんまりすごい式なので内容をつかんでいません。

雇用年月日から、期末日までの満月数は
  ( Year ( 期末日 ) * 12 + Month ( 期末日 ) ) - ( Year ( 雇用年月日 ) * 12 + Month ( 雇用年月日 ) )  - ( Day ( 期末日 ) > Day ( 雇用年月日 ) )

これを12で割った整数が年、その余りが月になりますね。

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.004 seconds, 7 queries executed - Memory usage: 500.91 KiB (Peak: 515.87 KiB) ]