Hi, I am trying to use an iF statment to check in a database if a time has been booked and if so a message is returned yes it sounds easy but the catch is this.
A user enters a booking time in a form this time is then used to check the times already entered in the database. I already have an IF statement that compares matching times, however if their is also a time(s) that are only less than the time entered by the user by 15 mins or greater than the time by adding 15 mins then a booking cannot be made as booking can only be made if they are 15 mins apart either way.
The code I have so far is thus.
<% IF mytime BETWEEN (RS("bookingtime"-15 AND RS("bookingtime"+15) THEN %>
<% errorForm "Booking time taken" %>
<% END IF %>
I get an error on this statement I don't think it likes the BETWEEN function.
Any ideas would be welcome.
Thanks.
A user enters a booking time in a form this time is then used to check the times already entered in the database. I already have an IF statement that compares matching times, however if their is also a time(s) that are only less than the time entered by the user by 15 mins or greater than the time by adding 15 mins then a booking cannot be made as booking can only be made if they are 15 mins apart either way.
The code I have so far is thus.
<% IF mytime BETWEEN (RS("bookingtime"-15 AND RS("bookingtime"+15) THEN %>
<% errorForm "Booking time taken" %>
<% END IF %>
I get an error on this statement I don't think it likes the BETWEEN function.
Any ideas would be welcome.
Thanks.