Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have a date field called CNTDATE and I require a field that displays the following:

if the day of CNTDATE falls between 16th and the last day of the month ,it shows the day as the 10th and the following month ie (CNT DATE = 18/1/2008)

Result = 10/2/2008

but if the CNTDATE day is between 1st and 15th (January, for example)

Result = 25/1/20008

here is what I have so far for my "calc" field:

If (Day ( CTNDATE ) ≥ 16 ; Day ( 25 ) & Month(CTNDATE +1 ) & Year ( CTNDATE ) ; Day ( 10 ) and Month ( CTNDATE ) and Year ( CTNDATE ))

Calc result is DATE

can anyone show me where I am going wrong and should I have the field as a date field with a calculated value or a Calc field?

thanks

Posted (edited)

First you are using "&" in the first expression, "and" in the second one. Neither is correct, since the former returns a text result and the latter a logical one. You need to use the Date() function to construct a valid date from its elements. Also, Day (25) does not do what you think it does.

If (

Day ( CTNDATE ) ≥ 16 ;

Date ( Month ( CTNDATE ) + 1 ; 10 ; Year ( CTNDATE ) ) ;

Date ( Month ( CTNDATE ) ; 25 ; Year ( CTNDATE ) )

)

should I have the field as a date field with a calculated value or a Calc field?

If you don't intend to override the calculated result by a manual entry, make it a calculation field.

Edited by Guest
Posted

thanks, I see where I went wrong.

I think your example should have read:

If ( Day ( CTNDATE ) ≥ 16 ; Date ( Month ( CTNDATE + 1 ) ; [color:red]10 ; Year ( CTNDATE ) ) ;Date ( Month ( CTNDATE ) ; [color:orange]25 ; Year ( CTNDATE ) ) )

I have just tried this and it doesn't seem to work properly - the month is not moving on

This topic is 6182 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.