PARAMETERS [Select date from] DateTime, [Select date to] DateTime, [Please select vehicle] Text ( 255 );
SELECT Booking.[Booking ID], Booking.[Customer No], [Booking Details].[Vehicle Reg No], [Booking Details].[Date From], [Booking Details].[Date To], IIf(IsNull(VehicleBooked(-999,[Vehicle Reg No],[Date From],[Date To])),"Available","Not available") AS Availability
FROM Booking INNER JOIN [Booking Details] ON Booking.[Booking ID] = [Booking Details].[Booking ID]
WHERE ((([Booking Details].[Vehicle Reg No])=[Please select vehicle]) AND (([Booking Details].[Date From]) Between [Select date from] And [select date to])) OR ((([Booking Details].[Vehicle Reg No])=[Please select vehicle]) AND (([Booking Details].[Date To]) Between [Select date from] And [select date to]));
this is the sql code, i dont have asp code as i was using gridview and could not create the query, thanks