kredd
06-01-2005, 04:12 PM
ok, see if you can follow me :)
have a reservation form that asks for start and ending dates. both are seperate textfields and database fields. i need to be able to restrict users from submitting starting and ending dates if these dates already exist in database. that part is easy enough...what i can't figure out is how to restrict starting/ending dates that fall on the interim dates of existing reservations...example:
user1: start date to end date - 7/1/2005 to 7/10/2005
user2: start date to end date - 7/2/2005 to 7/9/2005
user2 should fail since his days fall inbetween user1's reservations. make sense?? :o
i've tried using between or not between - no success. even tried subtracting the start date from end date and then create an array using a for/next loop to build the interim dates by adding the num of days back to the start date as it loops thru. kinda seemed like i was onto something but hit a dead end and started confusing myself !! :p
thanks in advance, kelly
have a reservation form that asks for start and ending dates. both are seperate textfields and database fields. i need to be able to restrict users from submitting starting and ending dates if these dates already exist in database. that part is easy enough...what i can't figure out is how to restrict starting/ending dates that fall on the interim dates of existing reservations...example:
user1: start date to end date - 7/1/2005 to 7/10/2005
user2: start date to end date - 7/2/2005 to 7/9/2005
user2 should fail since his days fall inbetween user1's reservations. make sense?? :o
i've tried using between or not between - no success. even tried subtracting the start date from end date and then create an array using a for/next loop to build the interim dates by adding the num of days back to the start date as it loops thru. kinda seemed like i was onto something but hit a dead end and started confusing myself !! :p
thanks in advance, kelly