asp.net - SQL table Date Field Comparision -
I have two tables for my Book Reservation form: Book table (1-10) and status in one table; All positions are 'available' first.
The second table contains both the reseller and date fields (check-in, check-out) and the two tables attached to a foreign key. Therefore Table 1 has one-to-many relationship in Table 2; This means that 1 book can be reserved by many students.
Problem:
When I receive a reserved request, the book looks like 1; Then the position of that book 1 should be changed to 'Oh Hold' for that time (on Table 1). When the second request comes for the same book, overlap at the same date range or date, then some messages like this This date is already reserved or similar, so the second requestor can not reserve for the same book on the same date, but he can request another book.
How can I turn on the current SQL table date
thanks,
>
Actually you may be looking at the patterns of this date:
- The first date can not be in the reserved category.
- The last date can not be either in the reserved category
- If the first date is less than the first date reserved, the last date can not be more than the previous date reserved category:
Some current reservations will be found:
Select reserved from where book = @bookId and ((Start date between @dat_ini) or (between @_date_end_date and end_date) ) Or (@dat_ini & lt; begin_date AND @dat_end & gt; end_date))
Comments
Post a Comment