A
Angelina
Hi,
I have written the query below which selects all
equipment that has been booked within a specific date
range. This part of the query is working fine.
The Start_date and End_date of the rental is specified by
the user at the interface.
SELECT dbo.Equipment_Inv.Equip_Inv_No
FROM dbo.Equipment_Booking INNER JOIN
dbo.Equipment_Inv ON
dbo.Equipment_Booking.Equip_Inv_No =
dbo.Equipment_Inv.Equip_Inv_No
WHERE (dbo.Equipment_Booking.Rental_Start_date BETWEEN
@Start_Date AND @End_Date) OR
(dbo.Equipment_Booking.Rental_End_Date BETWEEN
@Start_Date AND @End_Date) OR
(@Start_Date BETWEEN
dbo.Equipment_Booking.Rental_Start_Date AND
dbo.Equipment_Booking.Rental_End_Date) OR
(@End_Date BETWEEN
dbo.Equipment_Booking.Rental_Start_Date AND
dbo.Equipment_Booking.Rental_End_date)
What i want is a query that displays a list of all
equipment inventory numbers (Equip_Inv_No) that are
available for the specified date range that the user
specifies.
The query above only shows me those that have been booked
for that date range. Can anyone help me or guide me in
writing this new query. I have tried to use a subquery
with a NOT IN statemnet but i keep getting the following
error message:
ADO error: Parameter Information cannot be derived from
SQL statements with sub-select queries. Set parameter
information before preparing command.
Can anyone plz help??
I have written the query below which selects all
equipment that has been booked within a specific date
range. This part of the query is working fine.
The Start_date and End_date of the rental is specified by
the user at the interface.
SELECT dbo.Equipment_Inv.Equip_Inv_No
FROM dbo.Equipment_Booking INNER JOIN
dbo.Equipment_Inv ON
dbo.Equipment_Booking.Equip_Inv_No =
dbo.Equipment_Inv.Equip_Inv_No
WHERE (dbo.Equipment_Booking.Rental_Start_date BETWEEN
@Start_Date AND @End_Date) OR
(dbo.Equipment_Booking.Rental_End_Date BETWEEN
@Start_Date AND @End_Date) OR
(@Start_Date BETWEEN
dbo.Equipment_Booking.Rental_Start_Date AND
dbo.Equipment_Booking.Rental_End_Date) OR
(@End_Date BETWEEN
dbo.Equipment_Booking.Rental_Start_Date AND
dbo.Equipment_Booking.Rental_End_date)
What i want is a query that displays a list of all
equipment inventory numbers (Equip_Inv_No) that are
available for the specified date range that the user
specifies.
The query above only shows me those that have been booked
for that date range. Can anyone help me or guide me in
writing this new query. I have tried to use a subquery
with a NOT IN statemnet but i keep getting the following
error message:
ADO error: Parameter Information cannot be derived from
SQL statements with sub-select queries. Set parameter
information before preparing command.
Can anyone plz help??