Hello all, my apologies if this is answered elsewhere but I've spent the better part of the day seeking the answer to no luck. I am relatively new to Access, and know pretty much nothing about VBA or SQL language.
I'll try to be brief in the background for this: I work at a college, we connect several rooms via camera/mics, allowing the instructor to teach to multiple rooms at the same time. We have a system that automatically connects all the necessary rooms to a conference at a set time (class start time + a variable pad), then disconnects everything at another set time (end time + 4 minutes). That "variable pad" is what is giving me the headaches. If NONE of the rooms in a class are in use 15+ minutes before class starts, we put a 10 minute pad on the start of the conference. If ANY of the rooms in a class are in use within 15 minutes before start time, we put a 4 minute pad on the start of the conference.
I have several tables linked together within a query to give me (among other things): Title, StartTime, StartPad (which is just StartTime - 15 minutes), EndTime, Room. I would like to compare the StartPad of one class to the EndTime of the previous class and let me know if there's a conflict. Or indicate how much time there is in between. Or anything at all that would let me know that which classes get which pad (10 minutes or 4 minutes).
I found this last week: http://allenbrowne.com/appevent.html and it's a great way to see where the conflicts are, but it includes both events in a given conflict. This means that it will give me the title of both classes, even if one of them has no conflict before it. (For example, I have a HIST class that runs 9:20 - 10:15 and there is no class right before it. There is a GEOG class that runs 10:25 -11:20. The method linked above will return BOTH the HIST class and the GEOG as "conflicting", even though the HIST class has nothing before it. I understand why it works that way, but it's not what I need.) So I ultimately get a list of any class that either starts or ends within 15 minutes of another, rather than only those that start within 15 minutes of another's ending. This is why I emphasized "previous" above.
I also found this: http://allenbrowne.com/subquery-01.html#AnotherRecord, but the issue I find here is that I'm comparing different fields (EndTime to StartPad), whereas the example uses identical fields (ReadDate). I attempted to substitute my fields for the example ones and got an error message ("This expression is typed incorrectly, or it is too complex to be evaluated...") I've triple checked all my spelling and such and I do not see any errors there.
Again, I know almost nothing about SQL or VBA so go easy on me with the "I assume you know how to ____", I probably don't know how to ____! Any light that can be shed on this topic would make me and my ulcer (I call it "Databasery") very happy! If I've not been clear enough about anything I'm happy to go into more detail, I just didn't want to weigh the post down with anything unnecessary.