Autor Thema: Zeitvergleich kompliziert, warum so komisch?  (Gelesen 10822 mal)

Offline Rob Green

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 2.651
  • Geschlecht: Männlich
    • Meipor
Re:Zeitvergleich kompliziert, warum so komisch?
« Antwort #20 am: 20.03.03 - 13:32:30 »
hi George, how did you find this thread in the huge I-Net and zillions of informations? wow... :o

Your meeting room db was a very good starting point to my own application. congrats! But, when i stumbled across the given minute-time-slots-code posted above i wondered what the reasons could have been by the developer to choose that kind of - well - "complicated"  ;D solution.
I was unsure to adopt that alternative or choose another way.


The thread is about this way:

1 new, planned appointment, lets say 03.31.03 08:00-10:00
1 old, existing appointment, lets say 03.31.03 09:00-11:00

Now, how to check for time collisions?

The idea
  • 1. check:

is New STARTDateTime > Old ENDDateTime
IF YES: no time collision
IF NO: 2nd check
[/list]
  • 2. check:

is New ENDDateTime < Old STARTDateTime
IF YES: no time collision
IF NO: time collision
[/list]

In our example above the first condition is FALSE
since 03.31.03 08:00 is not > 03.31.03 11:00
The second condition is FALSE too (the new appointment isnt ending before the start of the old existing appointment)
since 03.31.03 10:00 is not < 03.31.03 09:00


So its a one-liner:

if SDTnew > EDTold  OR EDTnew < SDTold then
  collision_flag$="no"
end if

(.."DT".. stands for = "DateTime")

Now im nearly finished with my project and im a little proud of it because it goes a bit further, mastering repeating appointments, fulltime events with >1 day and starting time > end time and so on and so on...

Thanks again for your DB as a very good starting point!!!
*bows*
« Letzte Änderung: 20.03.03 - 13:37:22 von Rob Green »
Vielleicht verdirbt Geld wirklich den Charakter.
Auf keinen Fall aber macht Mangel an Geld ihn besser.
(John Steinbeck)

Meiporblog: http://www.meipor.de/blog
allg. Unternehmerblog: http://www.m-e-x.de/blog

Offline eknori

  • @Notes Preisträger
  • Moderator
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 11.728
  • Geschlecht: Männlich
Re:Zeitvergleich kompliziert, warum so komisch?
« Antwort #21 am: 20.03.03 - 13:37:39 »
@Rob:

ich habe ihn auf  "den richtigen Weg" geführt; habe in der Sandbox einen Link auf deinen Thread hinterlassen.  ;D ;D
Egal wie tief man die Messlatte für den menschlichen Verstand auch ansetzt: jeden Tag kommt jemand und marschiert erhobenen Hauptes drunter her!

Offline Rob Green

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 2.651
  • Geschlecht: Männlich
    • Meipor
Re:Zeitvergleich kompliziert, warum so komisch?
« Antwort #22 am: 20.03.03 - 13:41:11 »
ah..dankeschön...hätte ich depp selbst machen sollen, wenn ich mich schon von Dritten bzw. deren Ideen befruchten lasse zwecks einem netten Dankschön  ;)
Vielleicht verdirbt Geld wirklich den Charakter.
Auf keinen Fall aber macht Mangel an Geld ihn besser.
(John Steinbeck)

Meiporblog: http://www.meipor.de/blog
allg. Unternehmerblog: http://www.m-e-x.de/blog

Offline GeorgeF

  • Frischling
  • *
  • Beiträge: 2
  • Wheres my minority report?
Re:Zeitvergleich kompliziert, warum so komisch?
« Antwort #23 am: 24.03.03 - 12:49:27 »
H Rob

I found the thread from the link in the Sandbox with the Comments section where my db is located.

Why did I make it so complicated using the time slots the way I did?  Well, The version of the db that I posted onto the sandbox was a different version in that they only had seven (7) rooms which would make the database code much easirer to handle, as you have done and shown.  

In my live version it was more complicated because they had rooms that had partitions that could be removed so that one room could be combined to create a larger meeting room.

Shown below is the room setup that display in my room selection list:-

Boardroom 1
Boardroom 2
Boardroom 3
Boardrooms 1 & 2 combined
Boardrooms 2 & 3 combined
All Boardrooms 1 - 2 & 3 combined
Project room

As can be seen from above rooms 1 2 & 3 could be combined this made it more complicated in checking what room(s) were free (a nightmare).  I was playing with the time slots idea and decided to stick with it, although I like your idea.

But as I mentioned before when your under pressure by the boss you don't often see the wood through the trees.

If I am not presuming too much, can you send a copy of your db with the option of repeating bookings to:-

george.france@pinkroccade.co.uk

I would appreciate a fresh look at your version

Thanks George

GBF...

Offline Rob Green

  • Freund des Hauses!
  • Gold Platin u.s.w. member:)
  • *****
  • Beiträge: 2.651
  • Geschlecht: Männlich
    • Meipor
Re:Zeitvergleich kompliziert, warum so komisch?
« Antwort #24 am: 24.03.03 - 13:08:00 »
ok, im still working on it...my customer isnt that unhappy, since he has already 115%  ;D  np..i will send it to you if im ready.

The combination of rooms is as in my DB...im playing with multiple ressources in one entry. But, the collision routine is always the same, just a for all loop between.
Vielleicht verdirbt Geld wirklich den Charakter.
Auf keinen Fall aber macht Mangel an Geld ihn besser.
(John Steinbeck)

Meiporblog: http://www.meipor.de/blog
allg. Unternehmerblog: http://www.m-e-x.de/blog

 

Impressum Atnotes.de  -  Powered by Syslords Solutions  -  Datenschutz