Start my year in September (1 Viewer)

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
Hi.

I work in education and I'm currently creating a database for all our SEN pupils. Because their year group will increase by 1 each September I use 'Start Date' and work out the year group from that. That way it will increment automatically each year.

Problem is, it won't update till January, and it needs to +1 on September 1st.

At the moment I use a calculated field in my table with the Expression
Code:
((2014-[StartDate])+6)
How do I add to that expression that if the current year is after September then we add 1 to the year group.

e.g.

I'm adding in our current Year 7's at the moment.
  • I put Start Date into my form as 2013 (it's a value list btw) and the Year Group shows 7.
Which at the moment is correct, but come September, it needs to change to 8.

How do I expand my expression to reflect the above?

Cheers all

T.

I've also just noticed that I'm using 2014 as a constant.. How would I change that to run from 'now'
 
Last edited:

namliam

The Mailman - AWF VIP
Local time
Today, 09:37
Joined
Aug 11, 2003
Messages
11,695
Well you should start at the core of this problem, being you are not storing your startdate as a proper date field.
If you were and had Sept 1, 2009 in there a simple date diff would calculate it for you
 

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
Cheers for your reply - thats that thing i need help with. How do i do what i wnat to accomplish?

Thanks

Chris
 

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
Hi guys.

Thanks for the help so far.. It's taking a bit to sink in though sorry :confused:

Should my expression now look like this?

Code:
(((DateSerial(Year(Date()),1,9))-[StartDate])+6


-----------------------------

I tried that, it said no..

So.. I've made another table and called it tblCurrentYear. in there is one date field with 1/09/2014 in it called dteCurrentYear. I've no problems with updating this field once a year if necessary.
How do I reference that field in my expression from my main database?
 
Last edited:

namliam

The Mailman - AWF VIP
Local time
Today, 09:37
Joined
Aug 11, 2003
Messages
11,695
If you want to calculate the "most recent" Sept 1...

dateadd("M",-9,Date()) will force the current date back 9 months, resulting in the year where you need to be using the year() function.

Year(dateadd("M",-9,Date()) )

Then if you need the actual sept 1st date of that year:
dateserial(Year(dateadd("M",-9,Date()) ),9,1)

Is that what you want/need?
 

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
Hi all..

Thanks for the suggestions but I'm not having much success..

I've attached a screen shot of the table and the form - maybe that will help.

Cheers again.

:D

ps - nbrYearGroup is the box with a number 7 in it.. our tutor groups are 7X, 7Y, 7Z, 8Y etc etc
 

Attachments

  • Calculated Field.jpg
    Calculated Field.jpg
    99.3 KB · Views: 144

pr2-eugin

Super Moderator
Local time
Today, 08:37
Joined
Nov 30, 2011
Messages
8,494
If you'd have mentioned that you are using Calculated field I/other posted would have said to you, why your design is not idea. Since you have brought it to the light now, here you go.

Calculated Fields: http://allenbrowne.com/casu-14.html
 

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
I did though?

At the moment I use a calculated field in my table with the Expression
Code:
((2014-[StartDate])+6)
 

plog

Banishment Pending
Local time
Today, 02:37
Joined
May 11, 2011
Messages
11,648
The best way to do this is with a function in a module:

Code:
Public Function get_SchoolYear(in_Date) As Integer
    ' takes a date (in_Date) and returns the school year it falls in

ret=Year(in_Date)         ' return value, default is calendar year of in_Date

If (Month(in_Date)>=9) Then ret=ret+1
    ' if in_Date is September or later, moves year to next year

get_SchoolYear=ret

End Function

Once you have that function in a module, you can use it anywhere, on any date. For example, you could create a query to determine what school year a every pupil started:

Code:
SELECT PupilID, PupilFirstName, PupilLastName, get_SchoolYear(StartDate) as YearStart
FROM PupilTable;

You could also use it on a form/report, to put the current date's school year atop it:

=get_SchoolYear(Date())

A function is probably the best way to handle this.
 

vbaInet

AWF VIP
Local time
Today, 08:37
Joined
Jan 22, 2010
Messages
26,374
To be honest, if I were you I would go through a roll over process, i.e. run a query to migrate the kids from their current year group to the next year group. This is what normally happens on the school's database anyway.

You could ask your IT department to give you a fresh list every September and run some queries to update your database.
 

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
Many thanks for all your help..

In the end I went for the public function - mainly because I understood that one..

I can see the simplicity in the roll over process, but there is still a fair bit of roll over stuff to do each year. I wanted to automate as much as possible really.

Sorry if I've been a bit vague in my explanations.

T.
 

vbaInet

AWF VIP
Local time
Today, 08:37
Joined
Jan 22, 2010
Messages
26,374
Well the reason why I brought it up is because of this... in the very unlikely event that a child fails to move up a level, what do you do? As you know, there's a very slim chance but it happens.
 

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
Well the reason why I brought it up is because of this... in the very unlikely event that a child fails to move up a level, what do you do? As you know, there's a very slim chance but it happens.

Hi vbaInet,

Reason being is I'm making this database for use in school and not everyone knows how to run queries, excel flummoxes most people. I'm making a system that run's itself as much as possible to limit end user 'messing'.. I won't be in this job forever so I don't want to leave the school with a system they don't know how to use.

If I knew that this was going to be run by someone with technical knowledge then yes, I could include a roll over process - but to me it's a button press that doesn't need to be pressed..

(hope I don't come across arrogant or anything, appreciate your advice and may include something like in other parts of the database. You've already planted seed of thought re. an admin panel..... :cool: )
 

vbaInet

AWF VIP
Local time
Today, 08:37
Joined
Jan 22, 2010
Messages
26,374
Not a problem. I've done some work in the Education sector before and built some aspects of it so I was just giving you some insight.

Your school's pupil management system will mostly have a SEN tickbox that identifies those pupils which special needs and if the data is managed properly your IT department can easily build a quick query to pull this data and the necessary fields required. I would be inclined to get this data directly from them.

As with most schools a pupil doesn't necessarily move into the same form group (e.g. 9A to 10A) and in this case if you require form groups in your system you will need to manually update this info. This is another scenario you need to consider.

The seed of thought I'm trying to plant is not really an admin panel but requesting the data directly from your IT department at the end of year (as they tend to run the end of year process weeks before the start of the new academic year).

Good luck though :)
 

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
Not a problem. I've done some work in the Education sector before and built some aspects of it so I was just giving you some insight.

Your school's pupil management system will mostly have a SEN tickbox that identifies those pupils which special needs and if the data is managed properly your IT department can easily build a quick query to pull this data and the necessary fields required. I would be inclined to get this data directly from them.

As with most schools a pupil doesn't necessarily move into the same form group (e.g. 9A to 10A) and in this case if you require form groups in your system you will need to manually update this info. This is another scenario you need to consider.

The seed of thought I'm trying to plant is not really an admin panel but requesting the data directly from your IT department at the end of year (as they tend to run the end of year process weeks before the start of the new academic year).

Good luck though :)

I am the guy that sorts the data out at the end of the year.. and yes our 'whole school system' should monitor our SEN kids - but it doesn't. I'm therefore trying to create our own version specific to our monitoring and tracking needs.

If you've been in education then you'll be aware that the SEN department can become quite large. This database and future expansions of it should be in the main school system (and I've tried asking) - if I don't do it myself, then it'll never happen, we'll get too big for our current system and things will start going wrong.

argh.. I always worked in what I call 'proper jobs' before I came to a school - and boy do they take their time here lol.
 

vbaInet

AWF VIP
Local time
Today, 08:37
Joined
Jan 22, 2010
Messages
26,374
Yep, a data cleansing exercise can take ages but it's definitely worth it.

Sounds like you're a one man team. Good luck there ;)
 

Techie2k

Registered User.
Local time
Today, 08:37
Joined
May 5, 2009
Messages
12
Not quite one man.. Though it is a lot to get my head round.. Really wish sometimes I could grab a VBA expert and sit them next to me for a day lol.
 

Users who are viewing this thread

Top Bottom