Hi all,
I am trying to find the second to last date (max Startdate - 1) from a group of student attendances.
Example:
Id Name SchName Startdate Endate
1 Jim Sch1 01/09/2010 20/10/2010
1 Jim Sch2 01/11/2010
1 Jim Sch3 09/10/2011
2 Kim Sch1 09/10/2011 20/12/2011
2 Kim Sch2 01/10/2012 09/10/2013
3 Pat Sch1 01/09/2009 20/07/2010
3 Pat SCh2 01/09/2010 20/10/2010
3 Pat Sch3 01/11/2010
4 Mic Sch1 09/09/2013
Desired output:
1 Jim sch2 01/11/2010
2 Kim sch1 09/10/2011
3 Pat sch2 01/09/2010
4 Mic sch1 09/09/2013
I would like to do this in one query and would like to know how this is done.
The attendance information comes from a separate query and the student information from another query. Is this possible? :banghead:
Thanks for any advice
I am trying to find the second to last date (max Startdate - 1) from a group of student attendances.
Example:
Id Name SchName Startdate Endate
1 Jim Sch1 01/09/2010 20/10/2010
1 Jim Sch2 01/11/2010
1 Jim Sch3 09/10/2011
2 Kim Sch1 09/10/2011 20/12/2011
2 Kim Sch2 01/10/2012 09/10/2013
3 Pat Sch1 01/09/2009 20/07/2010
3 Pat SCh2 01/09/2010 20/10/2010
3 Pat Sch3 01/11/2010
4 Mic Sch1 09/09/2013
Desired output:
1 Jim sch2 01/11/2010
2 Kim sch1 09/10/2011
3 Pat sch2 01/09/2010
4 Mic sch1 09/09/2013
I would like to do this in one query and would like to know how this is done.
The attendance information comes from a separate query and the student information from another query. Is this possible? :banghead:
Thanks for any advice