我想使用以下SQL查询来显示记录,但在DropDate下却出现错误
在上下文中指定的非布尔类型的表达式,其中 情况可能是
这是我的查询
Select rm.RoomID,rm.RoomNo,rd.CheckIn,rd.CheckOut,ity.ItemTypeName,ln.ReservationID,g.GuestID,g.GuestName,ln.LaundryID,it.ItemName,ln.PickDate,ln.ServiceKind,l n.DropQty,ln.DropDate from Laundry ln
inner join Items it on ln.ItemId = it.ItemId
inner join ItemTypes ity on ity.ItemTypeId = it.ItemTypeId
inner join Rooms rm on ln.RoomID = rm.RoomID
left join Reservation_Guest rg on rg.ReservationID = ln.ReservationID
left join ReservationDetails rd on rd.ReservationID = ln.ReservationID
left join Guests g on g.GuestID = rg.GuestID where PickDate is not null
and DropDate and OutDate is null
我从DropDate收到错误,我希望显示具有PickDate的记录不为null,而DropDate和OutDate为null 请建议我任何更好的方法。
答案 0 :(得分:3)
SQL Server不支持布尔类型。而且,它不会将值转换为布尔表达式。大概您打算这样做:
auto p = new Foo {42, 17};