I have reservations table to store hotel reservations, this table has reservation_id, customer_id, rommno, and checking date also there is another optional field, checkout field which will use when person checked out and also the status field will updated to checkout status wile firstly putted checking status.
i need a query to find number of stayed dates from the checking date. needed result will look like this:
customer_id, roomno, checkin_date, due_nights
due nights will be result of subtraction of checkin_date and current date, i tried this sql query and it returns #Error
SELECT DATEDIFF(reservations.due_nights, now(), reservations.checkin_date) from reservations
my table view is link below