July 26, 200322 yr Maybe somebody has this calculation somewhere? I need to calculate the amount of days from a particular year (gYear = 2003) Anybody?
July 26, 200322 yr I'm sure we do, but I'm not sure what the results is suppose to be. What are you wanting for a result. Number of days from 2003 would be zero. Number of work days left in this 2003 would be 112, Number of days left in 2003 would be 158 Lee
July 26, 200322 yr Author Lee, Result needs to be a number; like: gYear = 2003 (has 365 days) = 365 or the same calculation for the amount of month days: gMonth = March, 2003 (has 31 days) = 31
July 26, 200322 yr Or for those who prefer less "mathematical" formulations: Case(not Mod(gYear, 400), 366, not Mod(gYear, 100), 365, not Mod(gYear, 4), 366, 365)
July 27, 200322 yr Hmm... DayOfYear(Date(12,31,gyear)) sounds simple too. For the Months, I'd go with (Date(gMonth+1, 1, gyear)) - Date(gMonth, 1, gyear) The number of days per year may also be : (Date(01, 01, gyear+1)) - Date(01, 01, gyear) Don't we always say FM has a thousands ways to go...
July 27, 200322 yr > DayOfYear(Date(12,31,gyear)) sounds simple too. Forgot about DayOfYear function... that's much better. > For the Months, I'd go with > > (Date(gMonth+1, 1, gyear)) - Date(gMonth, 1, gyear) Or using the same approach as DayOfYear... Day(Date(gMonth+1, 0, gYear)) > Don't we always say FM has a thousands ways to go... Indeed... in these cases there are several good ways... unfortunately in some, the several ways are trade-offs of the "least of several horrors".
Create an account or sign in to comment