6 Replies Latest reply on Mar 17, 2014 10:07 AM by philmodjunk

# Auto enter School Year field to computers date.

### Title

Auto enter School Year field to computers date.

### Post

Hi! I am currently working on a student management database and i wanted to have a certain field (School Year) auto entered to the computers date. So if it is 2014 on the computer the field "School Year" will automatically enter the date 2014.

• ###### 1. Re: Auto enter School Year field to computers date.

Year ( Get ( CurrentDate ) )  is an auto-enter calculation that can enter the current year into a number field, but if you need a date like January 1, 2015 to enter a year of 2014 because the school year starts in the fall and ends next spring, you need a more sophisticated calculation such as:

Let ( T = Get ( CurrentDate ) ; Year ( T ) - ( Month ( T ) < 9 ) )

This will subtract 1 from Year ( T ) if the current month is January through August.

• ###### 2. Re: Auto enter School Year field to computers date.

What if i need a auto data entry like 2014-2015 in the field since school starts here in August and ends in May the next yr.? Thanks again for this!

• ###### 3. Re: Auto enter School Year field to computers date.

Well my crystal ball isn't that good.

Let ( [ T = Get ( CurrentDate ) ;
Y  = Year ( T ) - ( Month ( T ) < 9 )
] ;
Y & " - " & Y + 1
) // let

• ###### 4. Re: Auto enter School Year field to computers date.

Thank you! I will try this out right now.

• ###### 5. Re: Auto enter School Year field to computers date.

It works perfectly fine but i need your help one more time on this one.

The school year starts at Aug and ends in May the next yr. I tried changing my computers date to Aug but still displays school year 2013-2014. It should be 2014-2015 right?

I know this is too much but thanks again for this.

• ###### 6. Re: Auto enter School Year field to computers date.

The calculation is designed for the school year to start in September and end in July. You'd need to adjust the calculation to include August as the start of the new school year.

Let ( [ T = Get ( CurrentDate ) ;
Y  = Year ( T ) - ( Month ( T ) < 8 )  // 8 stands for the Month of August as the first month of the school year
] ;
Y & " - " & Y + 1
) // let