+ Post New Thread
Results 1 to 3 of 3
Coding Thread, [SQL] line management of teachers in Coding and Web Development; Hi, I'm trying to work out the best way to do this, either in SQL or VBA... I have an ...
  1. #1

    Join Date
    Jun 2007
    Uttoxeter, Staffordshire
    Thank Post
    Thanked 4 Times in 4 Posts
    Rep Power

    [SQL] line management of teachers

    Hi, I'm trying to work out the best way to do this, either in SQL or VBA...

    I have an Access database table with all of the staff in the school (containing fields USERNAME, JOBTITLE and LINEMANAGEDBY). The "linemanagedby" field is a reference to the username field. So for example, I can easily find out who line manages the head of ICT or all of the people that an assistant head line manages. This works perfectly.

    Now onto the problem...I've been asked to extend the system so that I can find out "greater depths" of line management. So for example, the assistant head line manages the head of ICT, the head of ICT line manages the ICT teachers and one of the ICT teachers line manages an NQT in the department. I need the system to be able to search for the Assistant Head and return all of the people that they directly line manage, and all of the people that they "indirectly" line manage if you understand me.

    I've started SQL queries and given up. I started to write a recursive function in VBA but gave up when it got stupidly complicated...

    Any ideas? Thanks!

  2. #2

    Join Date
    May 2009
    Thank Post
    Thanked 915 Times in 683 Posts
    Rep Power
    Oracle used to have a nice little SQL clause "Connect by" that would traverse tree structured data. Here's a post apparently doing the same in MsSQL.

  3. #3

    jinnantonnixx's Avatar
    Join Date
    Mar 2011
    In the Calamatorium.
    Thank Post
    Thanked 531 Times in 356 Posts
    Blog Entries
    Rep Power
    Pinal Dave's blog is good, and this example is pretty close to what you're looking for:

    SQL SERVER – Simple Example of Recursive CTE | Journey to SQL Authority with Pinal Dave
    Last edited by jinnantonnixx; 19th July 2013 at 11:16 AM.

+ Post New Thread

Similar Threads

  1. Replies: 11
    Last Post: 8th November 2011, 07:36 AM
  2. Who is your line manager?
    By Midget in forum General Chat
    Replies: 36
    Last Post: 12th March 2007, 12:15 PM
  3. No Instance for WSUS in SQL service manager
    By petectid in forum Windows
    Replies: 1
    Last Post: 6th February 2007, 01:05 PM
  4. Moodle Help! Lots of Teachers!
    By Disorder in forum Virtual Learning Platforms
    Replies: 2
    Last Post: 12th January 2007, 04:55 PM
  5. Who's your line manager?
    By steve in forum General Chat
    Replies: 25
    Last Post: 13th March 2006, 08:25 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts