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 5332 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Anyone know how to get date of the 1st of current month?

For example, todays date is 06/15/2010.

I want calc. to produce date of 06/01/2010.

Thank you!

Posted (edited)

dateField - Day ( dateField ) + 1

or for current date, make an unstored calculation (date ) using Get(CurrentDate) in place of your date field.

UPDATE: How FM interprets ... dateField - Day ( dateField) produces date of 6/0/2010 which FM translates to the last day of the prior month. Then +1 brings the date forward to first day of this month. Technique learned from Comment quite some time ago and now replicated as one of the coolest techniques out there.

Edited by Guest
Posted

Awesome tip! My final calc. looks like this:

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

Posted

You should also be aware of the date function:

Date( Month; day; year)

Like this:

Date( month( get(currentDate)); 1; year( get( currentDate)) )

Posted

BruceR thank you. Very straight forward and clean, you're right, I do need to be aware of this.

Posted (edited)

Thanks. The date function is very useful and there are some cool but not-quite-obvious features.

Like - how do you get the last day of the month?

The last day of a month is day zero of the next month:

date( 5 ; 0; 2007)

result: 4/30/2007

date( 6; 366; 2010)

result: 6/1/2011

Edited by Guest

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