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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add if greater than/equal Start Date And Less then/equal Stop Date

Status
Not open for further replies.

Cozmo2

Technical User
Apr 7, 2006
87
US
I need a formula to count

# of majors for past 5 years by school year.

For example if a major has a start date of 4/27/17 and the stop date is null I would need to count the major in the school year 8/1/2017 - 7/31/2018 and the school year 8/1/2017 - 7/31/2018.

Also if a major has a start date of 8/21/2103 and the stop date is 8/24/2015 I would need to count the major in the school year 8/1/2013 - 7/31/2018 and the school year 8/1/2013 - 7/31/2014, 8/1/2014 - 7/31/20158/1/2015 - 7/31/2016
 
Start by creating a School Year formula, using the current school year (as named by the ending year):

//{@currSY}:
Year(currentdate+153)

Then create one formula for each of five years, like this:

//{@currentYr}:
If (
isnull({table.stopdt}) or
{table.stopdt}>=date({@currSY}-1,8,1)
) and
{table.startdt}<date({@currSY},8,1) then
1

//{@LastYr}:
If (
Isnull({@table.stopdt}) or
{table.stopdt}>=date{@currSY-2,8,1)
) and
{table.startdt}<date({@currSY}-1,8,1) then
1

Repeat for three remaining years. Then you can insert summaries (sums, not counts) on each formula.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top