Maybe I am misundertanding, or more likely just don't have enough
information.  There is not going to be a special CF function to help with
this, you will need to write sql code to check for the room number being
assigned and the two dates to ensure a lack of conflict.  I saw another post
that seemed to be on the right track...but as he points out, the most
important thing is makeing sure you are using CreateODBCDate when storing
your dates to the database so that they are always in the same format and
more importantly, in a format with which your database is happy.

Let us all know if you need more direction then that if you continue to have
problems.

Mike Craig

-----Original Message-----
From: John McCosker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 3:35 AM
To: Fusebox
Subject: sql date functions


Hi all, can anyone help me with this.  I am building a hotel bookings site
in coldfusion.
If a room is booked from dateA to dateB I make a record in
#Dateformat(dateA, dd-mm-yy)#, #Dateformat(dateB, dd-mm-yy)# and room, time
etc.

There does not seem to be a sql function in coldfusion that will allow me to
determine if someone else trys to book the same room starting before DateA
and ending between both dateA and dateB.

Ok now I know I could build a second database table and do a 'select not
in', but it would not be as effective I feel.

Cheers
Jonny

Derry Northern Ireland
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to