Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How would you do this?

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
My Jury program calculates the amount due to each of our jurors at the end of their term of service. As is usual around here, nobody mentioned that at the end of the fiscal year, the payment needs to be split: hours worked through 6/30 in one fiscal year and hours worked after 7/1 in a new fiscal year.

I know when each term starts (each Wednesday) and the term is currently two weeks (this could change in the future).

What I need to determine is if the term that is selected to process includes 7/1. The only thing I could come up with is taking the start date, add the term time and then check if the start date is before 7/1 and the end date is after 7/1, if so, then run the FYE process, if not run the "regular" process.

Can anyone think of a different way to figure out if the FYE process needs to be run?

Thanks for any input!

les
 
If you want to avoid doing two comparisons you could try something like:
Code:
if FYE - StartDate in [ 0..TermTime-1 ] then
  RunTheFYEprocess
else
  RunTheRegularProcess;
but it's hardly worth the effort. Which ever is going to be the easiest to understand in 6 months time would be my answer.


Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top