SELECT PlaceID, IIF([tblContracts].[EndDate]<Now(),"Ocupied", "Open") AS [Status], Min([tblPlace].[InsertDate]) As [Insert], Min([tblContract].[StartDate]) As [Start], Min([tblPlace].[EndDate]) As [End], tblContract.RentPersonID FROM tblContracts GROUP BY PlaceID, IIF([tblContracts].[EndDate}<Now(),"Ocupied", "Open")
(I haven't tested this, so there may be a typo somewhere.
Steven
I am a loud man with a very large hat. This means I am in charge
Of course - there was an obvious typo
|