[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Hejsa
Jeg har lige stirret mig blind på det her.
Jeg har et projekt med noget fotograf booking, hvor man ikke skal kunne booke to opgaver inden for samme tids interval.
Der er flg væsentlige felter id int autoinc opgavenavn tinytext opgavestart timestamp opgaveslut timestamp
Så i min kontrolrutine laver jeg et check på om man kan indsætte
select id, opgavenavn, opgavestart, opgaveslut from fotografbestilling where (opgavestart between '2004/03/18 12:00' and '2004/03/18 12:30' or opgaveslut between '2004/03/18 12:00' and '2004/03/18 12:30')
Det virker sådan set OK, men problemet er jo når der kommer en opgave som falder helt uden for disse opgavestart og slut tidspunkter.
Fx har jeg en test hvor opgavestart er kl 10:30 og varer til 13:00, den bliver ikke fanget af denne rutine.
id opgavenavn left(time_format(opgavestart,'%T'),5) left(time_format(opgaveslut,'%T'),5) 631 byportræt 10:30 13:00
Prøv at tilføje: or '2004/03/18 12:00' between opgavestart and opgaveslut
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |