Jump to content

This topic is 7859 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

smile.gif

Posted

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

Posted

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)

Posted

Hmm...

DayOfYear(Date(12,31,gyear)) sounds simple too.

For the Months, I'd go with B)

(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... wink.gif

Posted

> DayOfYear(Date(12,31,gyear)) sounds simple too.

Forgot about DayOfYear function... that's much better.

> For the Months, I'd go with B)

>

> (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". wink.gif

This topic is 7859 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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