question about date add

Results 1 to 2 of 2

Thread: question about date add

  1. #1
    Join Date
    Dec 1969

    Default question about date add

    The code below adds a starting time and a duartion in minutes. If the 2 combined exceed 10:OO PM you should get the exceeds message. I&#039;ve never played with dateadd so I&#039;m a little comfused by something. IF the 2 add up to exactly 10:OO PM you get the exceeds message. For example 8:00 PM + 120 gets the exceeds but 8:00 PM + 119 does not. Is there a way aound this and what is the reason that the exact errors? Thanks<BR><BR>starttime = request("starttime")<BR>minutes = request("minutes")<BR>limit = cdate("10:00 PM")<BR>proposed = dateadd("n", minutes, starttime)<BR><BR>if proposed &#062; limit then<BR>Response.write "Exceeds time limit"<BR>Else<BR>Response.write "OK"

  2. #2
    Join Date
    Dec 1969

    Default RE: question about date add

    You can try using the vbscript function DateDiff.<BR>See your vbscript reference for more info.

Posting Permissions

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