Jump 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.

Any way to Get (Current Year)?

Featured Replies

Hello All,

I'm trying to figure out a way to calculate the number of years since the date of a musical composition.

This is mainly to filter "contemporary" composition from older compositions.

I would enter the date of the composition and then have a field subtract that from the current year.

I was hoping that there would be a "Get (Current Year)" function, but I see none.

So I've tried creating such a field with the Get (Current Date) function; then I tried to truncate this so that I would just get current year.

But I can't figure out way get it to do that.

I would appreciate any help you can offer.

Thank you

Year ( Get ( CurrentDate ) ) will give you the current year

  • Author

Ok, I figured a work around, but another question....

I made a field for Get (Current Date); then a field calculating for Year (Current Date). Then a made a field "Years Since Composition" that subtracted the Year of Composition from the Current Year.

Now the problem is this: I assume the Current Date is not updated automatically. Is there anyway to do this?

The reason is that I need to know Current Repertoire that have been composed in the last 50 years, and as time passes compositions fall out of this set of records....wish this can be done automatically....

You don't need to store Get ( Current Date) in a field. If you do, then it must be an unstored calc. So, any field that uses Get (CurrentDate) needs to be unstored.

I rarely respond but if you make a calculation with a result of number and unstored like this

Year(Get(CurrentDate)) - Year(Composition)

I think this should give you what you want as number of years between the two and you can do away with those year fields.

Why do you rarely respond, David, your answer is spot on!

Thank you bcooney. 99% I am wrong. I am here to learn not confuse others. I am entry level. This one answer I knew. Most I don't. But you made my day anyway.

Thank you bcooney. 99% I am wrong. I am here to learn not confuse others. I am entry level. This one answer I knew. Most I don't. But you made my day anyway.

Keep up the good work. :D

I try to answer questions here and there. But then i tend to get over ambitious and get one wrong. I feel like such a dunce I slink away and crawl in a hole until I feel brave enough to try again. Thankfully there are so many highly skilled developers here that are quickly able to point out my errors and promptly get the OP back on the right track. I have accomplished so much with the help of people on this board. I really want to be able to pay it forward by helping others. :)

Honestly, I think we answer questions on this forum with one hand tied behind our back. That is, we aren't often provided with the context of the requirement. So, we do our best.

There's rarely one right answer with FM (that's what keeps it interesting, for me).

Big deal you provide the wrong answer. We will all learn from that as well, and it might help the OP clarify their question.

-Barbara

It is not easy to ask something when we do not know what the 'something' is called. And if we knew what we needed, we would not be asking. I find it very difficult to phrase questions here. I pretend I am explaing to new co-worker what we are trying to do and then hope that someone here can translate it. When new to FM, it was very hard. Now that I am learning, it gets easier to ask but more difficult to work because more things in my mind make decisions more confusing.

But now ...

:soap:

But folks new to FM also have a responsibility to at least try to figure it out or search for answer. My kids (not my own kids but my classes) are mid teens and many of them just expect answers be given. So they do not try, they just ask. This makes lazy brains. It is good the world has so much stored, accumulated knowledge at our fingertips but it has removed problem-solving from our kids' minds. Anything not exercised atrophies.

Okay. I'm done. The search here is better than it used to be. I appreciate that. But it would be nice to get a found set and then be able to constrain like we can in FM.

One minor point...

If the Date of Composition is December 31, 2011 and it's January 1st, 2012, how old is the comoposition according to the calculation?

Not sure if it's ok if a the age can be off by a year or not.

Create an account or sign in to comment

Important Information

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

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.