edudna Posted March 11, 2007 Posted March 11, 2007 (edited) Name & Parameters: [color:red][big] Employ ( DateStart, DateEnd ) [/big] Description: This formula is accurate in almost all cases if someone want to express time in format: y years, m months, d days. I think that this is an invetion because accuracy was always a problem is such formulas in cases we want to express time not only as a number. Sample Input: Results: Recursive: no Formula: Let ([ Τ0=dateEnd-dateStart; T1=dateEnd-dateStart+1; T2=Day(dateEnd)-Day(dateStart); T3=Month(DateStart)=2 and Day(DateStart)=1; Τ4=Day(DateStart)=1 and Day(DateEnd)=31; T6=Month(DateStart)=1 and Month(DateEnd)=2; T7=Day(DateStart)=1 and Day(DateEnd)=29; T8=Day(DateStart)=1 and Day(DateEnd)=30; T9=Month(DateEnd)=6 or Month(DateEnd)=4; y=Int(T1/365,25); m0=Int(Mod(T1; 365,25)/30,4375); m1= Ceiling(Mod(T1; 365,25)/30,4375); d=Int( T1-(y*365,25)-(m0*30,4375)); T10=Month(DateEnd)=2 and d=29; T11=Month(DateEnd)=9 and d=30; T12=Month(DateEnd)=11 and d=30; T5=Month(DateStart)=Month(DateEnd) ≠ 1 and d ≠ 0; d1=Case(T2=0; 0; T3 and T2=28; 0; Τ4; 0; T6 and T7; 0; T8 and T9; 0; T10; 0; T11; 0; T12; 0; d); m2=Case(T2=0 and d ≥ 29; m1; T3 and T2 = 28; m1; Τ4 and T5; m1; T6 and T7; m1; T8 and T9; m1; T9; m1; T10; m1; T11; m1; T12; m1; m0) ]; y &" Years," & " " & m2 & " Months," & " " & d1 & " Days" ) Required Functions: Author(s) edudna-pascal Date: 03/11/07 Credits: Disclaimer: FM Forums does not endorse or warrantee these files are fit for any particular purpose. Do not post or distribute files without written approval from the copyright owner. All files are deemed public domain unless otherwise indictated. Please backup every file that you intend to modify. Edited March 11, 2007 by Guest
Søren Dyhr Posted March 11, 2007 Posted March 11, 2007 in cases we want to express time not only as a number Are we wearing dinnerjackets when such desire occures or other kinds of festive facination of say uniforms and closing ranks - to keynote speakers nonsense??? --sd
Lee Smith Posted March 11, 2007 Posted March 11, 2007 Your post makes no sense to me. Is this an attempt at humor? Lee
edudna Posted March 11, 2007 Author Posted March 11, 2007 Have you tested this or you want to upload a file for you? It works fine... Perhaps want some correction but the idea will be the same. Pascal
Søren Dyhr Posted March 11, 2007 Posted March 11, 2007 More despair! Such a function serves no other measure than a symbolic gesture ...which of course is urgent at certian situations, where pledge of allegiance is required. Perhaps such a thing could have had it's use the Mayan ages in Mexico with thier calendar, but in areas where either the Gregorian or the Julian are in use or have been used ...doesn't it make any sense, due ot leap years and variations in month lengths. So a CF like this is based on a desire to keep up appearances, pretty much in thread with this: Actions are not chosen for their intrinsic merits, but for their instrumental properties, viz. their capacity to achieve other objectives. From: http://www.chass.utoronto.ca/~jheath/ So I would like to know what's in this CF for the developer as such??? As usual are faceed with too little to go on, why would we wish to play a bluffers game?? Shouldn't we instead dissuade customers from desiring such nonsense??? I watched a movie the other night: http://imdb.com/title/tt0149624/ ...in the end of the story, is the main character in a court trial ...the judge teaches the sheriff of when a person speaks the the truth. It's when the story doesn't change over time, despite though how fantastic it might seem. If we keep up with such shenanigans, are we loosing our footing if the circumstances suddenly changes radically. --sd
edudna Posted March 12, 2007 Author Posted March 12, 2007 (edited) Soren, as I know of your posts here, you are a kind of FM philosopher but the concept here is to define some parameteres in order to correct the mistakes made by the subvisions of the 365,25 and 30,4375 in year, month and day just like the PHP language in web. This function as Lee can tell you is tough anyway. Lee tried to define the day as the last day of the month with the orthodox programming way but it did not work as we wish. Employ is a kind of anorthodox but it works and may someday we develop a function and write the code in more rational order to solve the FM problem. But this is a beggining of an invetion, just like humans inveted light, electricity, computers. My kind regards, Pascal Edited March 12, 2007 by Guest
Søren Dyhr Posted March 12, 2007 Posted March 12, 2007 (edited) more rational order to solve the FM problem For crying it out loud, this is not a filemaker problem!!! It's a problem of self sufficiency and hubris, which a Greek of all people should be cured from, by the reading of Herodotus! This has nothing to do with inventions at all: Unlike the empirical sciences, formal mathematics is based on provable truth; one cannot simply try a huge number of cases and conclude that since no counter-examples could be found, therefore the statement must be true. Plucked boldly from: http://en.wikipedia.org/wiki/Conjecture But lets approach your reasoning from another direction, what you apparently are after, is something telling if someone have managed to keep an employment for a certain measure, will there be a fair argument for SUSPENDING meritocracy ...provided the measure is precisely quantified enough. I can only urge you to read this article, which btw is about filemaker ...and especially the joke about the small aeroplane... http://www.smallco.net/RestrainYourself.pdf ...but do indeed take notice when he deals with wrist-watches, and tell me why the British havn't continued a very established tradition with Pounds/shillings/pence in a mixture of 20-based and 12-based? ...or why it inside GE's plant's in US is metric measures that rules when they dealing with blades for say turbines, but as soon as the employee's have left the factory gates is back 12 inches on a foot.... miles etc. when debating something "measurable" with buddies at a nearby diner?? What you're dealing with is what is customary in a given situation, just like people who recieves medals or recognition from our queen, either arrives in white gloves or refuses on republican grounds. --sd Edited March 13, 2007 by Guest Found an image where the "invention" is better exploitation of sweeping!
edudna Posted March 13, 2007 Author Posted March 13, 2007 Hi, Soren, Consider please that with this function Greek Educational Offices will work one hour less per day to complete the rutine task that is to exact the employment years of the teachers this is the basic philosophy here. And if you imagine that this means a huge reduction to the cost of the computers energy, this is an invetion, man. I am Greek but I am thinking like an American, Greek-American (this is a joke). Pascal
Søren Dyhr Posted March 13, 2007 Posted March 13, 2007 If it just were exact, it's an approximation - and while we're at it wasn't Byzans once part of Greece or actually the other way around. http://en.wikipedia.org/wiki/Byzantine_aristocracy_and_bureaucracy To me is it really http://pespmc1.vub.ac.be/SUBOPTIM.html - What is the real goal here, is to learn children enough to prevent them from building Kafkan mazes ...for their fellow citizens to get lost in - when they grow older. To me is it ridiculous to say anything about peoples merits, when they have been employed 1 year, 2 month and 4 days minus a lunchbreak ...if say they are the worst educators at all! You could similar have a CF measuring the blood going to their brains, if any?? ...one of the paramters must then be "dedication" and perhaps bloodtype... and if all fit's an ideal give the geezer a medal for the endurance. --sd
comment Posted March 14, 2007 Posted March 14, 2007 I think it's not that uncommon to find labor contracts an/or social laws that give benefits to workers based on the total accumulated working period. And - perhaps regrettably - the quality of the work performed is not taken into account. Such a document might say, for example, that the worker is entitled to a pension of x for each year, and y for each additional month, and z for each additional day. And the worker may have more than one working period to his credit, with gaps between them. So the problem, however "ridiculous", can be quite real in some circumstances. Of course, in such case the developer should not resort to inventing. He/she should consult their legal department regarding the EXACT method of computing the benefits, then come up with an algorithm that conforms to this method. Otherwise the developer is at risk of being sued in a class action for depriving thousands of workers of their rightful benefits.
Søren Dyhr Posted March 14, 2007 Posted March 14, 2007 Otherwise the developer is at risk of being sued in a class action for depriving thousands of workers of their rightful benefits Indeed a good point, the next issue is a lawsuit or turmoil from the ones being pulled out of their threadmill by this rationalization of what's intended to be bureaucratic, and Byzantine ...if they really had what it takes to conduct themselves in a marked, wouldn't they be hidden away with these calculations in the first place. A fair share of europes wars in the previous century, is originating in the decline of a feudal way of production, where a lot suddenly were left on thier own without skills or inclination to other things than labourintensive work at the estates and larger farms. Bureaucracy have been a safe haven for decades! --sd
comment Posted March 14, 2007 Posted March 14, 2007 Stranger things have happened, but I don't think Pascal's formula is bad enough to start a war.
edudna Posted March 15, 2007 Author Posted March 15, 2007 Soren,what the hell relation have the byzantine and the Greek History with FM functions, do you mean the way of thinking? I am a very educated person but I do not understand you sometimes. Comment is right we are not going to start a war here for something that finaly works and serve thousands of people. Pascal
Søren Dyhr Posted March 15, 2007 Posted March 15, 2007 do you mean the way of thinking? Yes! I believe you're educated but you have indeed paid too little attention to this (Meno) http://www.everything2.com/index.pl?node=Meno works and serve thousands of people Works is probably an exaggeration - it's "kind of" for a while ins't it? Take the Ottoman Empire it kind of worked if you should be fair, and served thousands of people (not greek in this case but...), and especially the Janissary worked (a lot were greek by birth), until the corps rebelled and formed the start of the decline. No social construct seems to work eternally! Or do you think it actually does with just few interruptions like this??? http://en.wikipedia.org/wiki/Regime_of_the_Colonels --sd
edudna Posted March 18, 2007 Author Posted March 18, 2007 This is a revision of employ function and I want Soren's comments about this. I put an attached file to compare employ and elapse function that Lee developed here in the library. Employ revision is obvious more accurate in all cases than elapse, but it is not included in the costum function library. I hope this is not fasism Soren. Pascal Employ.zip
Genx Posted March 18, 2007 Posted March 18, 2007 .. why not just use: http://www.briandunning.com/cf/518 ... or ... http://www.briandunning.com/cf/57 ... or even ... http://filemaker.custhelp.com/cgi-bin/filemaker.cfg/php/enduser/std_adp.php?p_faqid=5532&p_created=1129657697&p_sid=-ERH76bi&p_lva=&p_li=&p_topview=1 ... Prewritten.
edudna Posted March 18, 2007 Author Posted March 18, 2007 I have included age (Birth, theDate, Format) Function in the attached file. You can check out the file and see that employ function is still more accurate! I knew the age function before attemt to write employ. Ellapse is better than age function. You have missed episodes I think Pascal Employ.zip
Genx Posted March 18, 2007 Posted March 18, 2007 No need to be rude (though I'm not sure missing episodes can be accurately translated..) As a general note your CF could be shortened to: Let ([ Time=DateEnd-DateStart; FEB=Case( Month(Date(2 ; 29 ; Year(DateEnd) ) ) = 3 ; 28 ; 29 ); LastDay=Choose( Month(DateEnd) ; "" ; 31; FEB; 31; 30; 31; 30; 31; 31; 30; 31; 30; 31); Time1=Day(DateStart)=1 and Day(DateEnd)=LastDay; Time2=Day(DateEnd)-Day(DateStart)=0 and Time ≠ 0; Time3=If(Round(Mod(Time; 365.25)/30.4375; 0)=12; 0; Round(Mod(Time; 365.25)/30.4375; 0)); Time4=Day(DateEnd)≠1 and Day(DateStart)≠1; y0=Int(Time/365.25); m0=Int(Mod(Time; 365.25)/30.4375); d0=Int(Time-(y0*365.25)-(m0*30.4375)); d=Case(Time1; 0; Time2 and Time4; 0; d0); m=Case( Time1 ;Time3; Time2 and Time4; Time3; m0); y=If(Round(Mod(Time; 365.25)/30.4375; 0)=12; Round(Time/365.25; 0); y0) ]; y &"Years," & " " & m & " Months," & " " & d & " Days" ) As per which particular function is more accurate... That depends entirely on your interpretation. In the format DD/MM/YYYY, put in the following: Date Start: 30/01/2004 Date End: 31/03/2015 Employ returns: 11 years, 1 months, 29 days Ellapse returns, 11 Years 1 months 30 days Age returns: 11 years and 2 months, and 1 days ------ Date Start: 29/04/2007 Date End: 30/05/2007 Employ returns: 0 years, 1 months, 0 days Ellapse returns, 0 Years 1 months 1 days Age returns: 0 years and 1 months, and 1 days ------ Date Start: 30/04/2007 Date End: 30/05/2007 Employ returns: 0 years, 1 months, 0 days Ellapse returns, 0 Years 0 months 30 days Age returns: 0 years and 1 months, and 0 days ------ Which function is correct? Their only difference seems to be what they interpret the period of a month to be when comparing the day of month of the start Date and the day of month of the end date... The age function considers a month to be a day value greater in the following month than in the previous month.... The ellapse function is actually kind of dodgey, on the same day of the following month, (i.e. 30 april, 30 may) it considers 30 days to have past, on the next day of the following month, (i.e. 30 april, 31 may) it considers 1 month and 1 day to have past... In regards to employ() function being more accurate than both .. i'm not sure what that does, apparently on the 30 April and the 30 May -- 1 month has past, on the 30 April and the 31 may, 1 month has still past. I personally haven't criticized anyone's function, i merely question the need to re-invent the wheel? There are a lot of solutions that already exist to do what you want... and what is correct is really up to the developer (or rather the developers employer) to decide. In all honesty, I think employment accurate to a couple of days using any of these CF's is going to be a lot more accurate than what would be done by a person ... but as i said, it all comes down to interpretation, and each of these functions interprets something different -- the age function seems to be the only one that is consistent. Finally, Edudna, don't take criticism to heart, you're the only one who will miss out if you do... and Soren stop berating Edudna -- She (or he) is trying to contribute something to the community and this shouldn't be frowned upon, you made your point at the start (or somewhere in the middle) so please just let it go.
comment Posted March 18, 2007 Posted March 18, 2007 In order to measure accuracy, one needs a standard. You can define your own standard, as long as it's consistent. I don't know what your standard is, so I cannot say much about accuracy - except that any formula that uses 365.25 days as year's length and 30.4375 days as month's length is probably not designed to be accurate (never mind that the actual numbers are incorrect as averages). But these results do not seem very consistent to me: Jan 1 2007 - Feb 1 2007: 0Years, 1 Months, 0 Days Feb 1 2007 - Mar 1 2007: 0Years, 0 Months, 28 Days By what standard is this accurate? I have said several times that 'years, months and days' as such is meaningless. You have been very consistent in ignoring this. “The central task of education is to implant a will and facility for learning; it should produce not learned but learning people.” ~Eric Hoffer
edudna Posted March 18, 2007 Author Posted March 18, 2007 First I want to thank anyone who wants to make a comment even it is negative. Carl Popper said that something is scientific when it can fail to the human experience. Employ Function is according to Greek educational bureocracy. It counts one year at the last day of the month when the last day is 28, 29,30 or 31 at 12 a.m. but FM does this from 1st to 1st day. This the crucial difference between employ and age. When I use it finally I have to put the correction dateEnd-dateStart+1 to work properly. Age function is a good function but not as good enough in my case. I aggree with you that all these are finaly against human activity but when I will provide Greek Offices with a database that counts the employment years from 1 to 1 they are going to throw it away... Pascal
Søren Dyhr Posted March 18, 2007 Posted March 18, 2007 This is a revision of employ function and I want Soren's comments about this What do have in mind should be subjected to this CF, that I posses or could lay my hands on? The problem is here like testing if martians are green or just green'ish without at all asking like David Bowie. It's a discourse, where something is taking granted even if it's something you just pledge allegiance to - even though it in itself is daft as a brush. The greek autorities have however decided that the desired quantification nomenclatur means something at all. I would personally rather work for organizations that tolerates and appreciates gadflys inputs, than the ones striving to attract "dedicated followers of fasion" and brownnosers! --sd
Genx Posted March 18, 2007 Posted March 18, 2007 (edited) As comment said... by what means is the employ function accurate? 30 May to 30 April returns 1 month 0 days, 30 May to 31 April returns 1 month 0 days... Why don't you find out the exact formula your education department uses and post it here, then no one will question the accuracy of your cf. Why?... Because: A ) I doubt they actually sit there and count the days working out which year was a leap year, how many days in each month... they probably just dump it into excel to work out the x days that had past and then calculate on an agreed formula e.g. 1 year = 365 days, 1 month = 30 days, x day(s) = remainder rounded down... It might not be 'accurate' but it's accurate according to whatever formula they use. B ) it saves you guessing... and saves you time re-writing it later. And if your only issue with the age function was that you needed it to add a day, you just change the first line to say: Let ( [ theDate = theDate + 1 ;leapFactor = If ( Mod ( Year ( theDate ) ; 4 ) = 0 ; 1 ; 0 )]; ... but that then that produces a different result to all of your employ results... so... And if it is accurate to what the Greek department of eductation defines as employment length you might want to call it GreeceEmploy().. or if it's accurate to what your employer has in their contract, you might want to call it [myEmployerHere]Employ() Edited March 18, 2007 by Guest
comment Posted March 18, 2007 Posted March 18, 2007 Just a note about that custom function you keep refering to: http://fmforums.com/forum/showpost.php?post/191303/ http://fmforums.com/forum/showpost.php?post/213906/
Genx Posted March 18, 2007 Posted March 18, 2007 As i said i personally have nothing against any of them because frankly they are all designed to return something different -- each of the developers took on a different interpretation of the duration of dates... hence why i linked to three not just one. As a general note: If(Round(Mod(DateEnd-DateStart; 365.25)/30.4375; 0)=12; Round(DateEnd-DateStart/365.25; 0); Int(DateEnd-DateStart/365.25)) &"Years," & " " & Case( Day(DateStart)=1 and Day(DateEnd)=LastDayOfMonth ;If(Round(Mod(DateEnd-DateStart; 365.25)/30.4375; 0)=12; 0; Round(Mod(DateEnd-DateStart; 365.25)/30.4375; 0)); & " Months," & " " & Case(Day(DateStart)=1 and Day(DateEnd)=LastDayOfMonth; 0; Day(DateEnd)-Day(DateStart)=0 and DateEnd-DateStart ≠ 0 and Day(DateEnd)≠1 and Day(DateStart)≠1; 0; Int(DateEnd-DateStart-(Int(DateEnd-DateStart/365.25)*365.25)-(Int(Mod(DateEnd-DateStart; 365.25)/30.4375)*30.4375))) & " Days" ... I doubt that the education department in Greece goes through the above to try and work out a duration of employment ... and in all honesty the only way your going to get an accurate result is if you use days or even weeks or something that is strictly defined by the employer i.e. something that is consistent, a day will always have 24 hours, 0 minutes, 0 seconds, likewise a week will always have 7 days (i mean standard week not financial week or week of year or anything like that). Anyway -- I think you say it best here: The problem is not solving, but what to solve. Objectively, there is no correct answer to your question. You have to make some arbitrary assumptions, for example is Mar 31 to April 30 a full month? If yes, is Mar 30 to April 30 a full month? If not, then how can Mar 1 to April 1 be a full month? ...[and here]... I would check the exact wording in the defining document, because (as I have said again and again) "years, months and days" is meaningless by itself. I only continued with this topic because the 'accuracy' of any given function was questioned -- a function is always accurate ... according to the calculations used to derive a result that meets the definitions used -- Who has the right definition? Your Employer... Frankly though, sticking to days is a hell of a lot easier and more accurate because there are no definitions. A day is a day is a day is a day...
comment Posted March 19, 2007 Posted March 19, 2007 There's no argument about all that (how could there be?). But even when someone is performing nonsense, there are levels of performance. When I see a calculation with 365.25 (or even better, 365.2425), I can tell it's heading towards average year. When I see: leapFactor = If ( Mod ( Year ( theDate ) ; 4 ) = 0 ; 1 ; 0 ); I can tell it's heading towards disaster.
edudna Posted March 19, 2007 Author Posted March 19, 2007 (edited) Employ or Greekemploy what ever you want is adapted to the use of the common employment dates. They can never use the dates that you gave from 30th of March to 31 of April anyway... But now there is an explanation why they can not use any software in Greek Educational Offices to do that job and they calculate the employment time sometimes of 2000 teachers in 30 days or more in hand! Because databases until now fails to do so. Do not blame if I try to find something that fits ... Pascal Edited March 19, 2007 by Guest
RodSierra Posted March 19, 2007 Posted March 19, 2007 Not taking sides in this thread I only reference the following with regards to a Buddhist calandar. http://en.wikipedia.org/wiki/Buddhist_calendar Many years ago I decided this was best left to hand entry by year rather than trying to find a solution similar to a western all encompasing calendar solution that can deal with any and all years.
BruceJ Posted March 22, 2007 Posted March 22, 2007 Where can I get the Cliff Notes on Soren Dyhr's writtings? I worked hard in Western Civ class to avoid actually reading anything like this and instead just bought the little yellow Cliff Note booklets. I find that the more I drink , the moore these things start to make sense though... although I learned the hard way - don't drink and d FMP Develope - strange results will occur.
Søren Dyhr Posted March 22, 2007 Posted March 22, 2007 This must be the right one - I guess??? http://www.amazon.com/gp/product/0822010445/sr/ref=pd_cp_b_title/002-3729497-5038419?ie=UTF8&qid=1174592064&sr=1-1&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-41&pf_rd_r=0YQPV8EN40A9Q65YV0KN&pf_rd_t=201&pf_rd_p=252362401&pf_rd_i=0822005662 --sd
Recommended Posts
This topic is 6456 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