1

在上下文中指定的非布尔类型的表达式,当我将鼠标悬停在顶行时预期条件见图像:

sql图片问题

SELECT Bookings.Date, Bookings.Timebegan, Bookings.Timefinished, Bookings_1.Date, Bookings_1.Timebegan, Bookings_1.Timefinished, 
              Bookings.RoomID, Bookings_1.RoomID
FROM     Bookings,
              Bookings AS Bookings_1
WHERE Not Nz(([Bookings_1].[Timebegan]>=[Bookings].[Timefinished]) Or
  ([Bookings_1].[Timefinished]<=[Bookings].[Timebegan]) Or
  ([Bookings].[RoomID]!=[Bookings_1].[RoomID]) Or
  ([Bookings].[ID]=[Bookings_1].[ID]),False)
ORDER BY Bookings.ID, Bookings_1.ID;

有谁有想法吗?

4

1 回答 1

0

好谜(德摩根定律提醒;])。试试这个:

WHERE  
    (
        [Bookings_1].[Timebegan] is NULL
        OR [Bookings].[Timefinished] is NULL
        OR [Bookings_1].[Timefinished] is NULL
        OR [Bookings].[Timebegan] is NULL
        OR [Bookings].[RoomID] is NULL
        OR [Bookings_1].[RoomID] is NULL
        OR [Bookings].[ID] is NULL
        OR [Bookings_1].[ID] is NULL
        OR 
        (
         [Bookings_1].[Timebegan]<[Bookings].[Timefinished]
         AND [Bookings_1].[Timefinished]>[Bookings].[Timebegan] 
         AND [Bookings].[RoomID]=[Bookings_1].[RoomID]
         AND [Bookings].[ID]<>[Bookings_1].[ID]
        )
    )
于 2013-03-12T00:51:57.693 回答