Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Count days between dates.

Featured Replies

Hey..

I have two fields, date_created and date_fixed..

How can I make a calculation that says the number of days that went between those two?

If I for example choose 2012-09-27 in created field and 2012-09-30 in fixed field, then the calc should have been 3 days.

Any suggestions?

Simply subtract the two =

date_fixed - date_created

The result type should be a Number.

  • 2 years later...

I'm using this formula in a calculation field to attempt to give the number of days till the next holiday.

 

gNextHoliday - Get (CurrentDate)

 

The c field is set to unstored, the gNextHoliday date is set from the calendar picker, but nothing shows. I can't think what else I could have done wrong - any ideas anyone?

Hi Mike,

 

Make sure the field you have the drop-down calendar attached to is actually the right field and that it is type global - just beginning it with 'g' does not make it global.  

 

The calculation field would automatically set itself to unstored and would work under ALL circumstances even if no records were present and even if you haven't committed the record yet.

Thanks LaRetta,

I hadn't set it to global!! What a fool!

 

I am a bit disapointed that FM realise that gNextHoliday should have been a global field though. - I attribute at least half of this error to software :-)

How would FM know it should be global?  That is for the developer to decide.  Not everyone begins their fields with 'g' so FM couldn't go by that ... some trail their fields with '_global' and some put globals in all caps (FMStandards). 

 

So you are joking, right?  :-)

I'm sure he's joking, LR, but man, been there done that!

Hi Barbara!

 

Surprisingly, I've known a few folks who really thought beginning it with 'g' makes it global - absolute truth!  I take nothing for granted.  

Yes I was joking!!

 

 

(quickly calls lawyer to cancel legal action)

 

 

 

    (That was a joke too!)

I so have this same issue -- totally a FileMaker bug.  I type "cleintnumber" and it's very much obvious I mean "clientnumber" but FM doesn't fix it.  I mean, c'mon!  :laugh2:

I don’t think we know enough about what you are doing to call it a Bug?

 

In what context are you “typing a client’s name”, i.e. find mode, drop down menu, global field, etc. How about a demo file of what is involved? Is there relationships involved. have you check the fields for matching types, is the relationship based on indexable field?

Hi Lee -- not sure if your post was with respect to me, but a total joke. I'll accidentally transpose characters in a field name or a variable name within a script, and then am flummoxed why it doesn't work properly, until I check to see that I didn't enter the name correctly! :)

Ok, I didn’t pick up on the joke. 

Is the omission of an autocorrect for scripts and relationships another undocumented feature?

 

(Sorry my sense of humour is so poor that it's dragged down the level of this thread)

Autocorrect like on an iPhone? Then we can have websites like iPhone Autocorrect bloopers for Filemaker. That'd be really cool. :-P

Ok, I didn’t pick up on the joke. 

 

:)  No worries.  Backstory is that I did a mock up of the logic I wanted to add to a script, and it worked perfectly, and then when I built it into the production script, it didn't work . . . . I transposed two letters in a variable I was using.  :)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.