dates and ifs

Results 1 to 2 of 2

Thread: dates and ifs

  1. #1
    Join Date
    Dec 1969

    Default dates and ifs

    I have a form where you can select a START date and time as well as a FINISH date and time. I need to check to make sure that the date/time selected isn&#039;t already taken or overlaps.<BR><BR>example:<BR>date1START: 12/19/2003 8:00 am<BR>date1FINISH: 12/20/2003 5:00 pm<BR><BR>If the new selected date it between or overlaps those two i need to say there is an error. I&#039;m guessing I will use an loop for all the records in the database to test all the dates... I&#039;m having troubles with the IF statment to test between or overlap... any help would be great. thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: dates and ifs

    Do you mean something like this?<BR><BR><BR>cmdTemp.CommandText = "SELECT count(*) FROM Hotlink <BR>WHERE DateStart &#060; &#039;" & request("DateEnd")"&#039; AND DateEnd &#062; &#039;" & request("DateStart") & "&#039;" <BR><BR>Set rs1 = Server.CreateObject("ADODB.Recordset")<BR>&#039;re sponse.write cmdTemp.CommandText<BR>rs1.Open cmdTemp<BR><BR>If rs1(0) =0 Then

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts