geraldh Posted January 21, 2012 Posted January 21, 2012 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
Tom Elliott Posted January 21, 2012 Posted January 21, 2012 Year ( Get ( CurrentDate ) ) will give you the current year
geraldh Posted January 21, 2012 Author Posted January 21, 2012 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....
bcooney Posted January 21, 2012 Posted January 21, 2012 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.
David Nelson Posted January 21, 2012 Posted January 21, 2012 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.
bcooney Posted January 21, 2012 Posted January 21, 2012 Why do you rarely respond, David, your answer is spot on!
David Nelson Posted January 21, 2012 Posted January 21, 2012 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.
Vaughan Posted January 21, 2012 Posted January 21, 2012 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
Ron Cates Posted January 26, 2012 Posted January 26, 2012 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. :)
bcooney Posted January 27, 2012 Posted January 27, 2012 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
David Nelson Posted January 28, 2012 Posted January 28, 2012 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 ... 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.
David Jondreau Posted January 28, 2012 Posted January 28, 2012 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.
Recommended Posts
This topic is 4740 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 accountSign in
Already have an account? Sign in here.
Sign In Now