473,799 Members | 3,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dates and enrolment

I have a student table with studentid as pk and an enrolment date field as
date.

I have made a qry to group on date and count the number of enrolments for a
particular day.

What this doesnt give me of course are days where there were no enrolments
ie there are gaps in the dates.

Ideas would be welcome as to how I might get the missing days. My own
thought would be that I might need to store a table of days and then look
for all the days in the date table and those from the enrolment table but
that would require populating a new table and repopulating it with the new
days every time the query parameters are changed.

The query only looks at an intake day as a parameter to give the enrolment
dates over a 20 week period. ie criteria on Enrolment date :
=dateadd("w" , -20, [Intake Day] And <=[Intake Day].


This query will be used to get cumulative values over a set period so that
the school can build historical data and forecasts of student bookings.

Thank you in advance

Peter Bailey
Nov 13 '05 #1
1 1360
Hi Peter.

Yes: create a table of dates.

Create a query that uses an outer join on the date field, so you get all the
dates, and any matches. Group by date from the date table, and count the ID
of the enrolment table.

You can use this code to populate a table named tblDate, with a field named
TheDate with 10 years worth of dates:

Function MakeDates()
Dim dt As Date
Dim rs As DAO.Recordset

Set rs = DBEngine(0)(0). OpenRecordset(" tblDate")
With rs
For dt = #1/1/2004# To #12/31/2013#
.AddNew
!TheDate = dt
.Update
Next
End With
rs.Close
Set rs = Nothing
End Function

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Bailey" <pe*********@an daluz.fsbusines s.co.uk> wrote in message
news:cg******** **@newsg2.svr.p ol.co.uk...
I have a student table with studentid as pk and an enrolment date field as
date.

I have made a qry to group on date and count the number of enrolments for
a
particular day.

What this doesnt give me of course are days where there were no enrolments
ie there are gaps in the dates.

Ideas would be welcome as to how I might get the missing days. My own
thought would be that I might need to store a table of days and then look
for all the days in the date table and those from the enrolment table but
that would require populating a new table and repopulating it with the new
days every time the query parameters are changed.

The query only looks at an intake day as a parameter to give the enrolment
dates over a 20 week period. ie criteria on Enrolment date :
=dateadd("w ", -20, [Intake Day] And <=[Intake Day].


This query will be used to get cumulative values over a set period so that
the school can build historical data and forecasts of student bookings.

Thank you in advance

Peter Bailey

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1820
by: Ajith Prasad | last post by:
I would appreciate advice on how best to formulate the following problem in Python. I have originally posted the problem to the J Programming forum and received a one-line formulation ((#s) (|.s)&(+/@:*)\ I)! I was wondering what the equivalent Python formulation would be. The Problem: The enrolment E(n) of an institution at the beginning of year n is the sum of the intake for year n, I(n), and the survivors from the intakes
10
3297
by: Colin Steadman | last post by:
I'm a stupid ASP programmer and I dont do Javascript (except for very simple tasks anyway), and I'm in a bit of a predicament. I've used a javascript table sorting script from here: http://www.ipwebdesign.net/kaelisSpace/useful_tableSort.html This works great except it doesn't sort my UK formatted dates properly, and I end up with something like this: Birth Date (dd/mm/yyyy)
12
2448
by: Dixie | last post by:
I am trying to calculate the number of workdays between two dates with regards to holidays as well. I have used Arvin Meyer's code on the Access Web, but as I am in Australia and my date format is dd/mm/yyyy, I have found that the dates I put in my holidays table are reversed into American dates. So, the wrong holiday dates are subtracted from the total workdays between the start and end dates. Is there an easy fix for this? ******Code...
1
15792
by: pitfour.ferguson | last post by:
My dbase has the start date and end date of each visit. How can I ask Access to list the day of the week of the start (easy), end (easy) and, more importantly, the dates of the visit itself - ie list the dates between the start and end date. Basically I am doing a day of the week analysis and need to know which day of the week is busiest.
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10484
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.